Solved

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

Posted on 2013-05-28
1
6,177 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now