This is a migrated thread and some comments may be shown as answers.

RadAlert back button cache problem

1 Answer 54 Views
Window
This is a migrated thread and some comments may be shown as answers.
Michael VS
Top achievements
Rank 1
Michael VS asked on 23 Mar 2010, 12:51 AM
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

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 25 Mar 2010, 09:20 AM
Hello Michael,

I see that lingovmir has already answered you in your Stack Overflow post on the same subject. The answer that he provided is correct - the behavior that you experience comes from the way Ajax works.
What I could suggest as a solution is to Ajaxify the button as well. For convenience I attached a small sample to this thread that shows the suggested approach in action.


All the best,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Michael VS
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or