How to prevent `A potentially dangerous request.path` warning on an ASP.NET Webform?

0

I have a page which is pulling back some html (an actual page) from the database stored as a string of HTML.

This is then being set as the source of an iframe by doing this:

iTemplatePreview.Src = Requests.lstDDLTemplates[templateIDToPreview].HTMLText;

However, this is being prevented due to:

A potentially dangerous Request.Path value was detected from the client (<).

[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (<).]
System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9940272
System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +53

The few articles directly relevant to this problem say that putting:

validateRequest="false"

In the @Page.

However this is not preventing this error.

Any ideas?

c#
asp.net
exception
webforms
dangerous-request
asked on Stack Overflow Apr 10, 2019 by Captain Wibble

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0