How do I call a client script function from a server side button click(with submit behaviour set to false) .
protected void Button4_Click(object sender, EventArgs e)
{
//System.Threading.Thread.Sleep(2000);
lbDateTime.Text=System.DateTime.Now.ToString();
ClientScript.RegisterClientScriptBlock(this.GetType(),"success","saveSuccess()");
}
You should set the OnClientClick attribute of the Button like
this way you keep the sumbit behaviour to false, and you also call the client script function.
Also, if you want to do this via server side code you can add this to your Page_Load
However, if you want to call the script after the “save” has completed, and you are using asynchronous jobs, and an UpdatePanel, then you should call
after the asynch job has finished, and the data have been saved.