• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7328
  • Last Modified:

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>
0
finance_teacher
Asked:
finance_teacher
1 Solution
 
Kumaraswamy RCommented:
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now