How to display alert message in asp.net which having only ok button.

Posted by Jitendrasoft09 under ASP.NET on 3/29/2013 | Points: 10 | Views : 15654 | Status : [Member] [MVP] | Replies : 3
Need to create one alert which having the ok button after click on the button to navigate another page and if no anyone clicked on that button automatically hide after 30 seconds.

Jitendra Kumar
If my post helps you, plz mark as an answer.



Responses

Posted by: Vuyiswamb on: 3/29/2013 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
This is how you can do it


response.write("<script> alert('hello world');</script>");


Thank you for posting at Dotnetfunda
[Administrator]

Jitendrasoft09, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ankitsrist on: 3/29/2013 [Member] Starter | Points: 25

Up
0
Down
write this in your button property
onClientClick="javascript:alert("are u sure u want to redirect")";

and write this in your button click event handler
Response.Redirect("http://www.google.com");


Jitendrasoft09, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chaithragm on: 3/29/2013 [Member] Starter | Points: 25

Up
0
Down
this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Type message here'); window.location.href = 'Default.aspx';", true);

Jitendrasoft09, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response