alert box in ascx page

Posted by Klbaiju under C# on 6/16/2010 | Views : 7089 | Status : [Member] | Replies : 5
Hi,

In my ascx page i want to use an alert box

this is my coding

Page.ClientScript.RegisterStartupScript(this.GetType(),"script", "<script type='text/javascript' language='javascript'>alert('Your Packagedate is greater than departuredate')</script>");

but not working

what i have to do

Regards

K L BAIJU




Responses

Posted by: Vuyiswamb on: 6/17/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
use this

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


Thank you for posting at Dotnetfunda
[Administrator]

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

Posted by: Klbaiju on: 6/17/2010 [Member] Starter

Up
0
Down
i tried this code but not working


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

Posted by: Vuyiswamb on: 6/17/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
What Error are you getting ?

One more thing i must say , Sometimes when we help people online , we dont have Visual Studio to give you the code, but we write an example, what you needed to do is to check the case sensativity of the code that i sent you and let intellisense guide you. take this


Response.Write("<script> alert('MyMessage');</script>");


Thank you for posting at Dotnetfunda
[Administrator]

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

Posted by: Rahulchd3112 on: 6/18/2010 [Member] Starter

Up
0
Down
Visit Here:
http://howinaspnet.blogspot.com/2010/05/confirm-message-in-grid-view.html

http://howinaspnet.blogspot.com

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

Posted by: Neeks on: 7/29/2010 [Member] Bronze

Up
0
Down
Please make sure that you have enabled the JavaScript in your Browser.


Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Enter your Alert Message Here....');", true);



Please try this code...

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

Login to post response