Irf
Irf

Reputation: 4617

Validate TextBox not to contain Certain Values

I am in a situation where in my asp.net page the TextBox should not contain following values
.Edit
.Delete
.ReadOnly

So How to validate this using RegularExpressions?

Upvotes: 0

Views: 241

Answers (3)

Shezi
Shezi

Reputation: 1342

Or you can use a single regularExpressionValidator and write

^\b((?!(Edit|Delete|ReadOnly)).)*$

LEt Me Know If That Helps

Upvotes: 1

Shezi
Shezi

Reputation: 1342

try this in three RegularExpressionValidators

^((?!Edit).)*$
^((?!Delete).)*$
^((?!Readonly).)*$

Offcourse you can tailor the regex according to your need.

Upvotes: 0

IrishChieftain
IrishChieftain

Reputation: 15253

Use a custom validator and check for each of these.

Upvotes: 0

Related Questions