I have a MasterPage sectioned into a <div> tag for a Logo, Banner and a ASCX LogIn control, with the rest of the page in a <div> having the <asp:ContentPlaceHolder> to host all my ASPX pages. The Login control is in an Update panel.
Problem :
Some of the ASPX pages have an ASCX page with a input form with text boxes with Custom Validators. When I click on the LogIn button, the resulting postback also tries to post this input data and fails since the forms are blank with no data….and thus the postback for the LogIn too does not go through. On other ASPX pages with no validations, the LogIn goes through.
I could solve this by having a separate page for Login…maybe with a ModalPopup etc ? But isn’t there any other way to tackle 2 buttons on the same page….one of which comes from the Master ?
If you aren’t validating the controls in the login form, just use CausesValidation=”false” on the login button. If you are validating the login form, use Validation Groups as recommended by MikeSmithDev to control which controls are validated on submit. Creating a Validation Group for just the login controls should segregate them from the other controls on the page.