Question

I stumbled on the ASP.net MVC HTML5 Toolkit and it looks great. However, I don't see any way to include a default value for HTML5 textboxes whereas this is possible using the standard MVC textbox.

Outside of Javascript, is it possible to add a default value to HTML5 textboxes from this toolkit?

Était-ce utile?

La solution

Hope this helps - you can actually add default values using the MVC HTML5 toolkit. The code will look something like this:

@Html.Html5TextBox("Name", InputTypes.InputType.Text, new { @Value = "Dean" })

And can be applied to any of the elements in the toolkit. For more details, take a look at this answer:

How to set a default value with Html.TextBoxFor?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top