Click here to Skip to main content
15,907,913 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello All

i have problem for two scriptmanager while click update button..

I have Code Like that


C#
ScriptManager.RegisterStartupScript(myPage, this.GetType(), "showalert", "alert('" + Message + "...!!');", true);

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", "FixHeader();", true);


while i click Update button alert message popup but my fixheader script nt set for gridview


Thank You All
Posted

Just change the showalert parameter with some other name and it will work.


C#
ScriptManager.RegisterStartupScript(myPage, this.GetType(), "showalert", "alert('" + Message + "...!!');", true);
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert2", "FixHeader();", true);
 
Share this answer
 
Comments
Yatin chauhan 2-Mar-13 0:22am    
Thank You Sheikh Muhammad Haris...!!
[no name] 14-Mar-13 19:33pm    
Kindly Accept Answer if it works for you. Thanks
1. i have problem for two scriptmanager while click update button..
You cannot have two scriptmanagers on a page. Only one.

2. Issue in code:
C#
ScriptManager.RegisterStartupScript(myPage, this.GetType(), "showalert", "alert('" + Message + "...!!');", true);
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", "FixHeader();", true);

I see you have given same name to two scripts. This simply means you copy-pasted it and have no idea what parameters are for RegisterStartupScript. Bad.
'showalert' -> have different names.
 
Share this answer
 
Comments
_Amy 1-Mar-13 23:51pm    
+5!
Yatin chauhan 2-Mar-13 0:21am    
Thx Sandeep...

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900