How to restrict specific combination of characters in afield

May 31 2020 10:51 AM
I don't want to allow, any alphabet  exactly after < in a textbox/textfiled.
User should not be able to submit if he/she enters "<x" in textbox/textfiled. where x = [a-z],[A-Z]
 
For Example 
Don't allow - 
1) k<Aw
2) <b
3) 1<head
4) ceK<<<<<<D 
Allow -
1) <
2) k<
3) l>
4) K<
5) )1w<.l
6) d<1b
7) B<,e
8) .kk<<<<<>a 
 
C# Code - 
 
[AllowHtml]
[RegularExpression(@"X", ErrorMessage = "Error Message for Don't allowed Text")]
public string Textbox { get; set; }
 
Please provide the value of X, which will meet my rquirement.
Note - The solution should work for multiline textbox also.

Answers (2)