Link to home
Start Free TrialLog in
Avatar of finance_teacher
finance_teacher

asked on

ASP.Net MVC 4 C# -- Html.EditorFor Set Default Value

I added the below , new object { @Value = "test" to my Create.cshtml, tested, and got an error.

How can I fix ?
--------------------------------------------------------------------------------------------------

      <div class="editor-label">
            @Html.LabelFor(model => model.PartDescription)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PartDescription, new object { @Value = "test" })
            @Html.ValidationMessageFor(model => model.PartDescription)
        </div>
ASKER CERTIFIED SOLUTION
Avatar of Kumaraswamy R
Kumaraswamy R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial