I want to do some client side validation and then after validation was passed execute some server side code.
as it is at the moment the server side code is not executing.
Advice perhaps on how I can achieve client side validation and server side execution with an asp.net button?
Kind regards
<asp:Button ID="butSubmit" Runat="server" OnClick="butSubmit_Click" OnClientClick="if (!ValidateLogin()) return;" Text="Submit"/>
Does this work?
OnClientClick="return (ValidateLogin())"
That is assumint it returns true or false, if it returns 1 or 0 (1 for ok to submit) you can try:
OnClientClick="return (ValidateLogin()===1)"