Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Dears,
 
i have the following script where i want to alert a message and redirect
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert","alert('Save Complete'); window.location='AddMerchant.aspx';", false);
 
The problem is that when i click back on the IE browser button the alert message is displayed again.
how can i avoid the popup message to appear again?
 
Regards,
Posted 14-Jan-13 9:55am
Edited 14-Jan-13 10:12am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

A startup script is always going to run on startup.
 
Try RegisterClientScript, but you have to call the function in the script
  Permalink  
Comments
Sandra Ha at 15-Jan-13 5:24am
   
RegisterClientScript didn't solve the problem
jkirkerx at 15-Jan-13 12:46pm
   
You probably have to change the script
 
ScriptManager.RegisterStartupScript(this, this.GetType(), "scriptName.js","fire_alert('Save Complete');
 
function fire_alert(message) {
alert(message);
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 547
1 Member 11120668 188
2 ChauhanAjay 180
3 Maciej Los 165
4 CHill60 135
0 Sergey Alexandrovich Kryukov 9,735
1 OriginalGriff 6,987
2 CPallini 5,835
3 George Jonsson 4,017
4 Gihan Liyanage 3,266


Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100