Domanda

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?

È stato utile?

Soluzione

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?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top