I have a Button with PostBackUrl. Also I have assigned a function to its onclientclick method in which some page logic were written including a couple of validation rules. if whole page were not valid this method returns False but I can not stop page. I have tried document.execCommand('Close') and Window.Stop() but no success.
Any suggestions?
Edit: Button:
<asp:Button ID="btnSubmit" runat="server" OnClientClick="return DoLogic()" PostBackUrl="http://google.com" Class="btn_submit"/>
DoLogic:
function DoLogic() {
if (ValidateForm()) {
blah blah blah
return true;
}
else {
alert("Has Error");
return false;
}
ValidateForm:
function ValidateForm(){
if (haserror)
{
return false;
}
return true;
}