Search code examples
c#asp.netrequiredfieldvalidator

ASP C# RequiredFieldValidator


[textbox1]

[textbox2]

[button1] [linkbutton1]

i have 2 textboxes, 2 RequiredFieldValidator, button1 and linkbutton. the button1 and 2textboxes are working properly with RequiredFieldValidator, but if i click the linkbutton the RequiredFieldValidator also appears.

I want the RequiredFieldValidator focus only in button1. Is this possible?


Solution

  • Set CausesValidation="false" in your link button markup like this

    <asp:LinkButton ID="lnkButton" runat="server" CausesValidation="false"></asp:LinkButton>