tags:

views:

40

answers:

3

The weird thing is If there is a javascript onClick() on a button, postback works otherwise, there is no postback. This was working very recently. I am not sure what recent changes made to the application made this happening throughout the site. The solution suggested by this link does not work as well (that link is applicable to .NET 1.1 though). Any idea whats going on?

EDIT:-

No postback when I have a button like this:-

<asp:button id="btnClick" runat="server" onClick="Click"/>

Postbacks when I have a button like this and I see the Click event handler code getting executed:-

<asp:button id="btnClick" runat="server" onClientClick="return Test();" onClick="Click"//>

and the corersponding JS function which would just return true at the end:-

function Test()
{
return true;
}
A: 

Are you sure the button is not wired up to some client side event handler? Could some client side validation script be firing?

Raj Kaimal
A: 

XML is case-sensitive.

I assume you need OnClick instead of onClick.

leppie
Leppie, that was a typo. I wrote that real fast. Sorry.
ydobonmai
A: 

Do you have any validation on your site? Could be that if the validation don't pass.

Fogh