Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to call javascript alert function showalert() based on condition in code behind.
My code :
if (CheckBox1.Checked == false)
{
----
}
else
{
button.Attributes.Add("onclick", "javascript:return ShowAlert();");
response.redirect("#");
}
but it's not working.
Posted
Updated 17-Mar-13 22:15pm
v2
Comments
Jameel VM 18-Mar-13 4:20am    
where is your showalert() function?

 
Share this answer
 
button.Attributes.Add("OnClientClick", "javascript:return ShowAlert();");
C#
txtItemName.Attributes.Add("OnKeypress", "return FocusOnEnterAll('" & txtDescription.ClientID & "',event);")
 
Share this answer
 
v3

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