razor - Set value to @Html.Editor MVC -


can me here, have following:

@html.editor("entities[" + @k + "].amount", entity.amount) 

i editor display amount in text-field. have tried following:

@html.editor("entities[" + @k + "].amount", entity.amount, new { @value = "45"}) <text> m</text> 

and got following error:

cs1928: 'system.web.mvc.htmlhelper<projectname.order>' not contain definition 'editor' , best extension method overload 'system.web.mvc.html.editorextensions.editor(system.web.mvc.htmlhelper, string, string, object)' has invalid arguments. 

any suggestions? thanks!

i used textbox instead , worked fine =)

@html.textbox("entities[" + @k + "].amount", entity.amount, new { htmlattributes = new { @class = "text-field" } }) 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -