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

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -