javascript - How to clear the form controls after submit the data? -
in google chrome when coming saved page empty in mozilla when return same form showing saved data in controls is. how clear form controls after submit data?
modelstate.clear();
but not working. , put below code in saving form.
window.onbeforeunload = function() { return "you work lost."; };
its clearing fields when return saving page when clicking save button throwing alert.
so how save without ask 'leave page' option , work clearing fields after save page?
try doing
instead of return view()
use return redirecttoaction("index")
[httpget] public actionresult index() { return view(); } [httppost] public actionresult index() { //your code// //model.savechanges(); return redirecttoaction("index"); }
Comments
Post a Comment