Setting default value for @Html.EditorFor in ASP.NET MVC -
hi i'm trying set value @html.editorfor
in view razor engine.
but value not displaying in browser when run application. issue?
here editor:
@html.editorfor(model => model.firstname, new { @value = "divaya sree" })
the best way initialize model in controller , pass model view
model.firstname = "divaya sree"; return view(model);
now can use
@html.editorfor(model => model.firstname)
or work
@html.textboxfor(c => c.firstname, new { @value = "divaya sree" })
Comments
Post a Comment