Here is the solution
http://forums.asp.net/t/999909.aspx/1[
^]
No you can't!
Workaround of this will be to pass some argument to page and after trapping that argument at server side..and then calling desired function. Here is the code snippet:
Understanding that you have Do_Insert as server side, implement your code like this:
'finishes server processing, returns to client.
Dim strScript As String = "<script language='JavaScript'>"
strScript += "if(confirm('" & strMessage & "')) {TestServer()} else{return false}"
strScript += "trScript += "script>"
RegisterStartupScript("confirm", strScript)
<pre lang="Javascript">function TestServer()
{
document.Form1.action=’YourPage.aspx?action=TestServer’;
document.Form1.submit();
}
Now this way you are indicating your page that required action to perform. Now in Page_Load event:
private void Page_Load(object sender, System.EventArgs e)
{
If (Request.QueryString["action"] != null)
{
If (Request.QueryString["action"] == "TestServer")
{
TestServer();
}
}
//rest of your code..
}