asp.net mvc 4 - Why httpGet action method not display the data into view in mvc 4? -
my problem view model,when pass values http action to http post action through view, view method not display values directly showing http post action without display view method why not displaying view?
[httpget] public actionresult index() { return view(); }
view model
public class sample { [key] public int id { get; set; } public string name{ get; set; } }
view
@using (html.beginform()) { @html.textboxfor(m=>m.name); <input type="submit" value="index"/> }
post method
[httppost] public actionresult index(string name) { return view(); }
i think not using httppost
method correctly. should doing way:
[httppost] public actionresult index(sample model) { return view(model); }
Comments
Post a Comment