Try defining sub for text_changed event for textbox object which reacts to lenght of textbox object. Don't forget to set the AutoPostBack property of the TextBox to "True".
A solution in
vb (page8.aspx with page8.aspx.
vb as code-behind file) would be:
page8.aspx
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Page8.aspx.vb" Inherits="Page8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Enabled="False" Text="Button" />
</div>
</form>
</body>
</html>
page8.aspx.
vb
Code:
Partial Class Page8
Inherits System.Web.UI.Page
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If Len(CType(sender, TextBox).Text) > 0 Then
Button1.Enabled = True
Else
Button1.Enabled = False
End If
Button1.Focus()
End Sub
End Class
hOPE IT HELPS