find space in space in login name

can anybody tell me the way to check whether the user name entered is contained space or not. using asp.net membership control, thanks
0
Sanjeev
3/7/2009 6:27:39 AM
📁 asp.net.security
📃 27051 articles.
⭐ 1 followers.

💬 3 Replies
👁️‍🗨️ 534 Views

It will be good if you let us know the exact requirement. anyways, space checking can be done this way

if(TextBox1.Text.IndexOf(string.Empty) > 0)

lblError.Text="space present" ;


SHASHANK BHIDE
CAPGEMINI INDIA
"THE ROAD TO SUCCESS IS ALWAYS UNDER CONSTRUCTION MARK MY RESPONSE AS ANSWER TO HELP ME BUILD IT :)"
0
shashankgwl
3/7/2009 8:13:49 AM

 Instead of using string.Empty, it should be

if (TextBox1.Text.IndexOf(" ") > 0)
{
  lblError.Text="space present";
}

 


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
3/7/2009 4:25:57 PM

YES YES, U R RIGHT, MY MISTAKE, HOW SPACE CAN BE EMPTY Embarrassed


SHASHANK BHIDE
CAPGEMINI INDIA
"THE ROAD TO SUCCESS IS ALWAYS UNDER CONSTRUCTION MARK MY RESPONSE AS ANSWER TO HELP ME BUILD IT :)"
0
shashankgwl
3/8/2009 11:08:59 AM
Reply: