G
Guest
Hi,
I'm not sure if the title is correct. Here's what I am having trouble with:
I have a server side button control where I am calling a javascript function
via the OnClientClick property. I also have a server side event handler to
handle the On_Click event on the postback. I wish to cancel the postback
based on whether the javascript function returns true or false. The problem
is that the I never get a postback and ofcourse the On_Click event never
fires. Here is my js:
function ConfirmSubmission()
{
return confirm("Do you want to continue?");
}
I set the button OnClientClick property as follows:
OnClientClick="ConfirmSubmission(); And I do have runat server to true.
How can I get this to work? Thanks in advance.
I'm not sure if the title is correct. Here's what I am having trouble with:
I have a server side button control where I am calling a javascript function
via the OnClientClick property. I also have a server side event handler to
handle the On_Click event on the postback. I wish to cancel the postback
based on whether the javascript function returns true or false. The problem
is that the I never get a postback and ofcourse the On_Click event never
fires. Here is my js:
function ConfirmSubmission()
{
return confirm("Do you want to continue?");
}
I set the button OnClientClick property as follows:
OnClientClick="ConfirmSubmission(); And I do have runat server to true.
How can I get this to work? Thanks in advance.