Turn off verification control when using LinkButton

I am using LinkButton to run an email template. When I click LinkButton, I need to disable all field validation tools

I tried the causevalidation property, but the checks still fire.

How to do this in C # / asp.net?

+3
source share
2 answers

Well, I don’t think you need to disable check items. I assume that you have another button on the page that runs all the checks, but you just want to skip them for that button.

Use CauseValidation = falsein 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

+12

OnClick LinkButton , , .

<asp:LinkButton runat="server" OnClick="btnLinkButton_Click"></asp:LinkButton>

protected void btnLinkButton_Click(object sender, EventArgs e)
{
    control1.Enabled = false;
    control2.Enabled = false;
}

, , .NET.

+1

Source: https://habr.com/ru/post/1744795/


All Articles