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

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -