Telerik RadAlert back button cache problem

Posted by Michael VS on Stack Overflow See other posts from Stack Overflow or by Michael VS
Published on 2010-03-23T23:07:05Z Indexed on 2010/03/24 10:43 UTC
Read the original article Hit count: 607

Filed under:

Hi,

I'm sure you have had this one before so if you could point me to something similar....

I have a server side creation of a RadAlert window using the usual Sys.Application.remove_load and add_load procedure however the alert keeps popping up as it seems to be caching when the user hits the back button after it has been activated. I have tried to put a onclick event on a button to clear the function using remove_load before it moves to the next page however it still doesn't seem to clear it.

Its used in validation so if a user inputs failed validation it pops up. If they then go and enter correct validation it then moves onto the next page. If they then use back button this is where it pops up again. Any ideas?

Server side:

private void Page_Load(object sender, System.EventArgs e) 
{
   if (!IsPostBack) 
   {
      btnSearch.Attributes.Add("onclick", "Sys.Application.remove_load(f);"); 
   }
}

private void btnSearch_Click(object sender, System.EventArgs e) 
{
   string radalertscript = "(function(){var f = function(){radalert('Welcome to RadWindow Prometheus!',     330,     210);   Sys.Application.remove_load(f);};Sys.Application.add_load(f);})()";

   RadAjaxManager1.ResponseScripts.Add(radalertscript);
}

Ive also tried using

   RadAjaxManager1.ResponseScripts.Clear();

before it moves on to the next page on the postback event

© Stack Overflow or respective owner

Related posts about telerik