CustomX
CustomX

Reputation: 10113

Requiredfieldvalidtor in asp.net stops me from going back?

When a user clicks a link, he's sent to a register form. In this form I have certain fields that need to be filled in. So I use required field validator on them.

On the page there is also a Back button, incase the user doesn't want to register. But when you press back, it says you need to fill in the fields or you won't go back.

Any suggestions on how this can be resolved?

Upvotes: 1

Views: 589

Answers (1)

Tim
Tim

Reputation: 28530

Set the CausesValidation property on the back button to false:

<asp:Button id="btnBack" runat="server" CausesValidation="false" OnClick="btnBack_Click" Text="Back" />

Upvotes: 2

Related Questions