How to set default value for Html.TextBoxFor in ASP.NET MVC ?


This content was proof-read by Grammarly. You can Try Grammary for FREE

You can set the default value for the Html.TextBoxFor extension controls in ASP.NET MVC by specifying the Value property as shown below.

How to set default value for Html.TextBoxFor in ASP.NET MVC ?

<%= Html.TextBoxFor(x => x.Age, new { @Value = "0"}) %>

%d bloggers like this: