Monday, August 27, 2012

Disable Postback using Javascript



'asp:button onclick="btn1_Click" onclientclick="return VerifyCondition(this);" runat="server" tabindex="1" text="Sample Button"'>;

function VerifyCondition()
{ var xxdropdown = document.getElementById('<%= ddlXX.ClientID %>');
  var selectedxx = xxdropdown.value;
   if (selectedxx == '0')
   { alert("Please select a value before proceeding.");
     return false;
  }
 else
 {
     return true;
 }
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.