Calling javascript function from CS page
var message = "<script type=text/javascript>SaveDraft();</script>";
System.Web.UI.ClientScriptManager clientScriptManager = Page.ClientScript;
clientScriptManager.RegisterStartupScript(this.GetType(), "Add", message);
or
var message = "<script type=text/javascript>alert('TemplateName already exists, please change the name');</script>";
System.Web.UI.ClientScriptManager clientScriptManager = Page.ClientScript;
clientScriptManager.RegisterStartupScript(this.GetType(), "Message", message);
ASPX page
function SaveDraft() {
alert('Support details saved successfully!');
}
var message = "<script type=text/javascript>SaveDraft();</script>";
System.Web.UI.ClientScriptManager clientScriptManager = Page.ClientScript;
clientScriptManager.RegisterStartupScript(this.GetType(), "Add", message);
or
var message = "<script type=text/javascript>alert('TemplateName already exists, please change the name');</script>";
System.Web.UI.ClientScriptManager clientScriptManager = Page.ClientScript;
clientScriptManager.RegisterStartupScript(this.GetType(), "Message", message);
ASPX page
function SaveDraft() {
alert('Support details saved successfully!');
}
No comments:
Post a Comment