calling alert function? [Resolved]

Posted by Varun66 under ASP.NET on 12/4/2013 | Points: 10 | Views : 656 | Status : [Member] | Replies : 2
How can i call an alert function from code behind file?




Responses

Posted by: Kmandapalli on: 12/4/2013 [Member] Silver | Points: 50

Up
0
Down

Resolved
Hi,

Just put the following line of code:

Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Content Updated successfully!!!');");", true);

When you want to call ajavascript function along with ur alert, then use the following code:

Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Content Updated successfully!!!'); PersistStateDdls(" + stateId + ");", true);

Mark as answer if satisfied.....

Regards,
Shree M.

Kavya Shree Mandapalli

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

Posted by: vishalneeraj-24503 on: 12/4/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
write:-
scriptmanager.registerstartupscript(this,this.gettype(),"alert_message","your_function_name",true).
it will call your method.

It will used in both cases,where you have used scriptmanager or not in your page.

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

Login to post response