1

When I user this targ on a page like:

@Html.TextBoxFor(model => model.JobName, new { @class = "form-control" })

It can work, But when I use like this:

@Html.TextBoxFor(model => model.JobName, new { @data-provide="typeahead", })

then it can't work, because this attribute: data-provide, it have a symbol which is '-', how I can solve this problem?

0

1 Answer 1

3

You need to use the underscore character (the helper will translate this correctly and generate data-provide="typeahead")

@Html.TextBoxFor(model => model.JobName, new { data_provide="typeahead", })
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.