I'm doing a search function for my webapp.
However, i'm trying to disable my search button if the user does not type any search condition in the search box. Unfortunately, i wasn't able to allow my webapp to automatically detect if the user type something in the search box which will eventually enable the search button. Vice versa, when the user delete any search value from the search textbox the button will be enabled again.
This is how i typed to place the condition in my searchbox called txtData but it doesn't work.
protected void txtData_TextChanged(object sender, EventArgs e)
{
if (!txtData.Text.Equals(""))
{
btnSearch.Enabled = true;
}
}
Is there any other way to detect words in textbox?
Regards.