开发者

Requiredfieldvalidtor in asp.net stops me from going back?

开发者 https://www.devze.com 2023-03-30 03:01 出处:网络
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.

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 y开发者_JAVA百科ou won't go back.

Any suggestions on how this can be resolved?


Set the CausesValidation property on the back button to false:

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号