1

I need to show some html code in TextBox. this is my TextBox description:

<asp:TextBox ID="responseTextBox" runat="server" Width="910px" ReadOnly="True" TextMode="MultiLine" CausesValidation="false" />

i am passing the html to it programatically, and it works, but on postback from page i'am getting the following error:

A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$responseTextBox=" ...

How can i disable input validation ?

2 Answers 2

5

asp.net imposes this checking to avoid script injections.But you can override this by changing the validateRequest property value to "false" in page directive

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="editpage.aspx.cs" validateRequest="false" Inherits="MyProject.UI.editpage" %>

Check here to know more about Script injection

Sign up to request clarification or add additional context in comments.

Comments

0

You can try adding the validaterequest=false attribute, but I would not recommend doing this. Encode/decode the HTML instead.

http://www.codersbarn.com/post/2008/11/01/ASPNET-Data-Input-Validation.aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.