-1

So I would like to display data in my admin tab view, which is not null as a placeholder value.

I though maybe something like this:

@Html.EditorFor(model => model.AmazonProductSKU, placeholder = model.AmazonProductSKU)

Or this:

@Html.EditorFor(model => model.AmazonProductSKU, new { @placeholder = T(model.AmazonProductSKU) })

But it breaks my tab.

Everything works, so model updates database etc.

Anyone have any ideas of how this might be accomplished, is it even possible?

Thanks peeps

Divyang Desai
  • 7,483
  • 13
  • 50
  • 76
Web Dev Guy
  • 1,693
  • 3
  • 18
  • 42

1 Answers1

0

It should be:

 @Html.EditorFor(model => model.Sku, new { htmlAttributes = new { @class = "form-control", placeholder = "Enter Amazon Product SKU Here" } })

If it comes from model use placeholder = Model.AmazonProductSKU.

 @Html.EditorFor(model => model.Sku, new { htmlAttributes = new { @class = "form-control", placeholder = Model.AmazonProductSKU } })

For resource string, you cannot use it as T(model.AmazonProductSKU), because T is custom helper in nopCommerce and accepting a string argument into it.

@Html.EditorFor(model => model.Sku, new { htmlAttributes = new { @class = "form-control", placeholder = T("AmazonProductSKU.Placeholder ") } })

And add that resource string from the admin panel.

Hope this helps!

Divyang Desai
  • 7,483
  • 13
  • 50
  • 76