Solved

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

Posted on 2013-05-28
1
6,492 Views
Last Modified: 2013-06-02
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
Comment
Question by:finance_teacher
1 Comment
 
LVL 29

Accepted Solution

by:
Kumaraswamy R earned 500 total points
ID: 39204412
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question