Click here to Skip to main content
15,907,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want tp display javascript alert message in .cs file here is my script ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Cannot Delete')", true);
uplcityDetail.update()//update panel id

in .cs file but code is executeing alert is not displaying can any tell me please
Posted
Updated 10-Dec-12 22:51pm
v2

1 solution

When you use update panel then you can not call javascript like above. You have to use
HTML
ScriptManager.RegisterStartupScript

Just change your
XML
ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Cannot Delete')", true);

to
XML
ScriptManager.RegisterStartupScript(updatePanelId,updatePanelId.GetType()
                                   ,"('Cannot Delete')", javaScript, true);
 
Share this answer
 

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