Solved

ValidateRequest="false" And AJAX 4 Controls

Posted on 2011-02-14
2
865 Views
Last Modified: 2012-05-11
Greetings;

I'm receiving an error in the end-postback routine of an AJAX 4 control. The text field in question is allowed to accept HTML tags and the page is coded with ValidateRequest="false".

Is there a way to allow HTML tags to pass validation when text is entered into an AJAX 4 control instead of receiving a code 500 error?


Much thanks ... David
0
Comment
Question by:David Bach
2 Comments
 
LVL 14

Accepted Solution

by:
Dhanasekaran Sengodan earned 500 total points
ID: 34896568
In ASP.NET 4, by default, request validation is enabled for all requests, because it is enabled before the BeginRequest phase of an HTTP request. As a result, request validation applies to requests for all ASP.NET resources, not just .aspx page requests. This includes requests such as Web service calls and custom HTTP handlers. Request validation is also active when custom HTTP modules are reading the contents of an HTTP request.

Solution for ValidateRequest="false" Issue in .Net 4.0

To revert to the behavior of the ASP.NET 2.0 request validation feature, add the following setting in the Web.config file:

<system.web>
<httpRuntime requestValidationMode="2.0" />
</system.web>

Open in new window

0
 

Author Closing Comment

by:David Bach
ID: 34900419
Greetings dhansmani;

Your answer was right on! I appreciate the fast response and excellent description of your answer.


Much thanks ... David
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now