Hello Guys,
I have a textbox called "NameTextBo x" and "Submit" button in my "index.aspx " page.
I need to check whether user entered name in the textbox before clicking submit button.
And, this is what I did:
But if the user enters spaces in the textbox, I am unable to check the string as empty.
Please let me know how to solve this issue.
Thanks.
I have a textbox called "NameTextBo x" and "Submit" button in my "index.aspx " page.
I need to check whether user entered name in the textbox before clicking submit button.
And, this is what I did:
Code:
string name = NameTextBox.Text.ToString();
if (name.Length == 0)
{
return;
}
Please let me know how to solve this issue.
Thanks.
Comment