jump to navigation

How To Stop Ajax Post Back when A button contains OnClick() and onclientclick events November 28, 2008

Posted by venkatworld in Uncategorized.
trackback
When A button Contains Two event functions ,one on client side and the other on Server side, The Page posts back  event occurs even when the page not pass  the validation.
 
To Avoid this unwanted postback ,we should  explicitly call
the method
 
Page_ClientValidate() in the javascript event method or function.
 
Here is the Example:
<

asp:ImageButton ID=”imgBtnSubmit” CssClass=”image” ValidationGroup=”Submit” onclientclick=”javascript:if(Page_ClientValidate())return HaspopUpClosed(); “ OnClick=”imgBtnSubmit_Clicked” runat=”server” ImageUrl=”~/res/images/img/Updatebtn.jpg” />

Comments»

No comments yet — be the first.