Hi akhter,
Check this example. Now please take its reference and correct your code.
HTML
<asp:TextBox ID="TextBox1" runat="server" />
<asp:Button ID="Button1" Text="Enable Disable" runat="server" OnClick="EnableDisable" />
<hr />
<asp:TextBox ID="TextBox2" runat="server" />
Code
C#
protected void EnableDisable(object sender, EventArgs e)
{
TextBox2.Enabled = false;
if (TextBox1.Text.Trim().ToLower() == "b")
{
TextBox2.Enabled = true;
}
}
VB.Net
Protected Sub EnableDisable(sender As Object, e As System.EventArgs)
TextBox2.Enabled = False
If TextBox1.Text.Trim().ToLower() = "b" Then
TextBox2.Enabled = True
End If
End Sub
Screenshot
Note : I have used Button click event. As per your requirement write code in the event you want to implement.