How can I block white space in textbox entries?
I tried this but it is not working:
[RegularExpression(@"/^\s/", ErrorMessage = "white space is not allowed in username")]
public string UserName { get; set; }
'^' negation should not allow white space in text but it does not allow me to enter any text in field. Any help?