문제

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?

도움이 되었습니까?

해결책

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top