Accepting certain tags in a textbox

G

Guest

ASP.NET will generate a failure/security warning, if you enter html tags into
a textbox (of course, the failure will come after the postback).

That's nice and useful, and I know you can turn it off completely, but is it
possible to turn it off just for certain tags, not all tags?
 
S

S. Justin Gengo

No, you'll need to turn it off for the page in question and then filter to
make certain that only the tags you want to allow may pass through.

I would suggest using a regular expression validator so that only the
characters you want to allow may be submitted to the page.

E.g. a regular expression to allow only letters and number would look
something like this: [A-Z][a-z][0-9] if you then add to that the characters
you'd like to allow you will still have protection from invalid characters
being entered.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"the friendly display name"
 
P

Patrick.O.Ige

Also to add to Justin's advice you should look at
:-http://www.regexlib.com/
and explore more of reg expressions.
Patrick


S. Justin Gengo said:
No, you'll need to turn it off for the page in question and then filter to
make certain that only the tags you want to allow may pass through.

I would suggest using a regular expression validator so that only the
characters you want to allow may be submitted to the page.

E.g. a regular expression to allow only letters and number would look
something like this: [A-Z][a-z][0-9] if you then add to that the characters
you'd like to allow you will still have protection from invalid characters
being entered.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"the friendly display name"
ASP.NET will generate a failure/security warning, if you enter html tags
into
a textbox (of course, the failure will come after the postback).

That's nice and useful, and I know you can turn it off completely, but is
it
possible to turn it off just for certain tags, not all tags?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top