In the below code i have been working on asp.net web application .in my case the textchange event is not firing.Pls help me to solve the issue. code:
public delegate void LeavingFocusHandler(int CurrentIndex);
public event LeavingFocusHandler LeavingFocus;
public string strValue { get; set; }
public int ItemIndex { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
this.txtField.TextChanged += new EventHandler(txtField_Leave);
}
void txtField_Leave(object sender, EventArgs e)
{
try
{
this.strValue = txtField.Text;
if (this.LeavingFocus != null)
{
this.LeavingFocus(this.ItemIndex);
}
}
catch (Exception ex)
{
throw ex;
}
}
Design code:
<asp:TextBox ID="txtField" runat="server"></asp:TextBox>