Link to home
Start Free TrialLog in
Avatar of dkilby
dkilbyFlag for Canada

asked on

ASP.NET + A potentially dangerous Request.Form value was detected from the client

I am trying to send a variable to flash, but it doesn't seem to work, this is an error i keep getting,

A potentially dangerous Request.Form value was detected from the client (number="12 <!DOCTYPE HTML PUBLI...").

i am trying to send the variable number = 12 to flash

this is what i have

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            Response.Write("&number=12")

        End Sub
Avatar of tusharashah
tusharashah

This is caused by the ValidateRequest attribute of the Page directive. By default it is set to true, which means that ASP.NET
examines all input for potentially dangerous data.

If you set the ValidateRequest to false in your web.config, machine.config or Page directive of your particular page, it should work.

----------------------------------------------
<!--Web.Config -->
<system.web>
     <pages validateRequest="false" />
 </system.web>


----------------------------------------------
//Your Page
<%@ Page language="c#" Codebehind="brandAdd.aspx.cs" AutoEventWireup="false" Inherits="Admin.brandAdd" ValidateRequest="false %>
----------------------------------------------


-tushar
Avatar of dkilby

ASKER

Tried that and it didn't work
ASKER CERTIFIED SOLUTION
Avatar of travisjhall
travisjhall

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm a bit surprised that my answer was accepted so easily, as it rather lacked substance. Of course, it's probably just that what I said was all the clue you needed to track down the bug. Still, if you need additional help, feel free to just say so. For 500 question points, I think you're entitled to a bit more help than what I gave, and I'm happy to give more of a hand (and more points really aren't necessary).