Sunday, 11 August 2013

Disable HTML asp textbox

Disable HTML asp textbox

When I use a HTML-element in my textboxes I was getting this error:

To fix this error, I did this:
Adding ValidateRequest="false" at the top of the .aspx page.
Adding <httpRuntime targetFramework="4.0" requestValidationMode="2.0" />
to the webconfig file.
After doing this, the error above didnt appear, and the HTML-elements that
I used were shown with the markup.
For example: I used the <b>Test</b> elements in the textbox, and this was
showed in a label as:
Test
But what I would like to have is, when someone adds HTML elements to my
textbox, the error shouldn't appear, and the elements shouldn't be
converted. So the label must show:
<b>Test</b> instead of Test (which is BOLD)
What can I do to make it like that?

No comments:

Post a Comment