Question: I want to prevent a user from entering blank spaces into a username textbox.I would be very grateful to the person,if anyone answered

Answer: 
Use Javascript code as below:

```
<input type="text" name="myText" onKeypress="if (event.keyCode == 32) event.returnValue = false;"/>

```

tested in `Internet Explorer`
you have to use something in javascript or jquery to avoid it. 
I suggest you a Jquery pluglin, my favorite one is that:

<http://www.meiocodigo.com/projects/meiomask/>