Fixed: PostBackUrl not working with OnClientClick

Posted by Unknown On Thursday, January 22, 2015 0 comments
Problem: I want to post data from login.aspx using postbackurl property in Asp.net Button. But I want to validate it first before sending data. But when I use postbackurl together with onclientclick function, It does nothing.

Solutions: Write JavaScript code instead of call JavaScript function.

ASP.NET Page
<asp:Button OnClientClick="if(!validateLogin()) return false;" 
     PostBackUrl="~/Account/authentication.aspx" Text="Sign in" runat="server" ID="butLogin" />

0 comments:

Post a Comment