In my application, There is one Textbox and on textchanged event of Textbox I have written some validation code. Now my Problem is when I put text into the Textbox and directly click any other Button, first Text Changed Event get fired and then I have to Click Button Again to fire Click Event of that Button. So how do I avoid Double Click of Button.
Any Help appreciated....
Regards,
VIkram
Sam HobbsPosted Sep 17, 2010, 5:48 PM
VikramPosted Sep 17, 2010, 3:26 AM
Here is Code:
protected void txtName_TextChanged(object sender, EventArgs e)
{
if ISExist(txtName.Text.Trim()))
{
lblErrMessage.Text = "Name Already Exist";
}
else
{
lblErrMessage.Text = string.Empty;
}
}
protected void IbtnReset_Click(object sender, ImageClickEventArgs e)
{
ClearFields(); // Function which clear all the fields on the Form.
}
Whenever there is no Text Changed Event for the Textbox Only one Click is required to Reset. I thing due to button Click event first postback happens which execute the textchanged event and after that Button Click Event Postback loses its focus.
How do I solve this problem. Any help Appreciated...
Regards,
VIKram
Sam HobbsPosted Sep 16, 2010, 3:02 PM