Alphi
Alphi

Reputation: 55

RequiredFieldValidation on asp.net

i got a little problem with the RequiredFieldValidation on asp.net. what i want to happen is when i click the "Log out" button the required field errors wont show up. i just want to know how to control this little beasts. that when i only press "Submit" button that is the only time they would check on errors, and when i press "Logout" button they would just sit there and wont show up.

enter image description here

they show up when i hit the logout button

Upvotes: 0

Views: 45

Answers (1)

Prasad Raja
Prasad Raja

Reputation: 703

try this

You need to stop the validation with the help of attribute CausesValidation="false"

<asp:Button ID="BtnLogOut" runat="server" Text="Logout" CausesValidation="false" />

CausesValidation

  1. When its true, it will fire the validation
  2. when its false it will stop the validation

Upvotes: 2

Related Questions