Friday, November 26, 2010

Assign default text in Html.TextBoxFor


To assign textbox value in MVC view, use the following syntax.

<%= Html.TextBoxFor(x => x.EmployeeName, new { @Value = "Enter Employee Name"}) %>

Here the @Value case is must.

No comments:

Post a Comment