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
Post a Comment