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

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -