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 " Know the answer? 01
Arun PottiAnswers in the forums20answers02
Tahir AnsariAnswers in the forums5answers03
Kamlesh KumarAnswers in the forums5answers04
Sam HobbsAnswers in the forums4answers05
Željko PerićAnswers in the forums3answersFull leaderboard →
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
For Example
Don't allow -
1) k
2)
3) 1
4) ceK<<<<<
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.
Note - The solution should work for multiline textbox also.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Arvind KushwahaRank #685 · 3.5K reputationPosted May 31, 2020, 7:54 AM EDT
Aurobinda Tripathy5 reputationPosted Jun 1, 2020, 3:16 AM EDT