我正在使用LinkButton来触发电子邮件模板。 当单击LinkButton时,我需要禁用所有字段验证控件
我尝试了Causesvalidation属性,但验证仍然被触发。
我怎么能在c#/ asp.net中做到这一点?
I am using a LinkButton to trigger an email template. When the LinkButton is clicked, I need to disable all field validation controls
I tried the causesvalidation property, but the validations are still triggered.
How can I do this in c# / asp.net?
最满意答案
好吧,我不认为你需要禁用验证控件。 我假设你在页面上有另一个按钮来触发所有的验证,但你只是想跳过这个按钮。
在LinkButton上使用CauseValidation = false
<asp:LinkButton id="LinkButton1" runat="server" Text="Generate Template" CausesValidation="False"> </asp:LinkButton >http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.causesvalidation%28VS.80%29.aspx
Well, I don't think you need to disable the validations controls. I assume that you have another button on the page that fires all validation but you just want to skip them for this button.
Use CauseValidation = false on your LinkButton
<asp:LinkButton id="LinkButton1" runat="server" Text="Generate Template" CausesValidation="False"> </asp:LinkButton >http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.causesvalidation%28VS.80%29.aspx
更多推荐
发布评论