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 -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -