c# - how to refresh a page in asp.net using maessage box event -
what want is, when click message box "ok" button, reload whole page. code generating message box.
scriptmanager.registerclientscriptblock(this, this.gettype(), "alertmessage", "alert('error!! try reloading page! ')", true);
this code reloading page.
response.redirect(request.rawurl);
so, want catch event generated "ok" button of message box. , use reload page.
try this.
scriptmanager.registerclientscriptblock(this, this.gettype(), "alertmessage", "alert('error!! try reloading page! ');location.reload();", true);
or
this option chose reload or not.
scriptmanager.registerclientscriptblock(this, this.gettype(), "alertmessage", "if(confirm("error!! try reloading page!")){location.reload();}", true);
Comments
Post a Comment