Reputation: 10570
I have this asp.net button
<asp:Button ID="okButton" runat="server" Text="Okay" OnClick="okButton_Click" />
this is the onButton_Click
function
protected void okButton_Click(object sender, EventArgs e){
//bla bla bla
//bla bla bla
}
I have also this javascript function
function callCenterDailyChartYMC() {
//bla bla bla
}
How can I execute that javascript function after finishing executing the button on click function?
Thanks
Upvotes: 1
Views: 1255
Reputation: 6894
You can register it as a startup script.
protected void okButton_Click(object sender, EventArgs e){
ClientScriptManager cs = Page.ClientScript;
string script = "callCenterDailyChartYMC();";
cs.RegisterStartupScript(this.GetType(),"NameOfYourScript",script,true);
}
http://msdn.microsoft.com/en-us/library/z9h4dk8y(v=vs.110).aspx
Upvotes: 1