开发者

No postback on any button click on ASP.NET 4.0 application

开发者 https://www.devze.com 2022-12-25 04:24 出处:网络
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 applica

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" on开发者_如何转开发Click="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;
}


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消