This is a migrated thread and some comments may be shown as answers.

RadTextbox special character issue

2 Answers 146 Views
Input
This is a migrated thread and some comments may be shown as answers.
shunman
Top achievements
Rank 1
shunman asked on 05 Dec 2012, 12:17 PM
Hello.

We have a problem.

If I input special character  "<br/>" or "<a>" into RadTextbox and submit data,

server exception error raised  "System.Web.HttpRequestValidationException"

please let me know how can I solve this problem.

2 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 07 Dec 2012, 12:57 PM
Hello Shunman,

The only way to prevent this error from appearing is to turn off Request Validation or remove the tags from your textboxes when submitting the form. If you want to keep these values, you can change you RadTextBox controls into RadEditor controls, if that is the kind of input you want to accept.

I hope that helps.
0
Maria Ilieva
Telerik team
answered on 10 Dec 2012, 09:38 AM
Hello Shunman,

One option to avoid this behavior is to attach the OnKeyPress event of RadTextBox and cancel the event if invalid character is pressed. 

Please go through the link below:
OnKeyPress



Kind regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
shunman
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Maria Ilieva
Telerik team
Share this question
or