开发者

How to a invoke a link button on aspx page

I have a user information aspx page and some control on this page have the validation controls and on this page two lin开发者_如何学编程k button Home and Login.

If I fill the entries and click on proceed or submit button then ok. But if i dont want to fill the entries and click on login page because i have already user of this page then click on login button but the login page is not opened because of validations control.

So plz tell me how I solve this problem to working on this button and validation are mandatory


Use CauseValidation = false on your LinkButton

<asp:LinkButton id="LinkButton1" runat="server"
     Text="Generate Template" CausesValidation="False">
</asp:LinkButton >


Another option is to use validation groups. If you assign a validation group to all of the controls that you want to be a part of the validation, then anything else will automatically be removed from it. So you could have one block of inputs on a page that are subject to validation, and they would all be a part of the same validation group. Then every other control on the page would be absolved and not fire validation when they are clicked.

This effectively achieves the same as when Rudrik proposed, the only difference is instead of explicitly identifying the controls that you do not want to be a part of validation, you have to explicitly identify the controls that you do want to be a part of it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜