Not able to disable Required Field Validator in VB.NET
<p>I have a required field validator for a textbox which I want to disable on click of a link button. I coded like so.</p>

<pre><code>Protected Sub lnkDeleteTimeSlots_click(sender As Object, e As EventArgs)
    txtTimeslotName_RequiredFieldValidator.Enabled = False
End Sub
</code></pre>

<p>The design of the textbox.</p>

<pre><code>&lt;asp:TextBox ID="txtTimeslotName" runat="server"&gt;&lt;/asp:TextBox&gt;
&lt;font color="red"&gt;*&lt;/font&gt;
&lt;asp:RequiredFieldValidator ID="txtTimeslotName_RequiredFieldValidator"
                            runat="server"
                            ErrorMessage="Timeslot Name Required!"
                            Display="None"
                            ControlToValidate="txtTimeslotName"
                            ForeColor="Red"
                            ValidationGroup="Timetable"&gt; 
&lt;/asp:RequiredFieldValidator&gt;
</code></pre>

<p>But it still validates for the required field. What is the issue?</p>

<p><strong>EDIT:</strong></p>

<p>The linkbutton is inside a grid. When it is clicked, I open a popup window with the textbox and a button. The code for the button is like so.</p>

<pre><code>&lt;asp:Button ID="btnMAdd" runat="server" Text="Add Timeslot" PostBackUrl="~/TimeSlots.aspx" OnClick="btnMAdd_Click" CssClass="button" ValidationGroup="Timetable"  OnClientClick="javascript:shouldsubmit=true;" /&gt;
</code></pre>
