Solved

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

Posted on 2004-08-14
4
771 Views
Last Modified: 2008-03-06
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
0
Comment
Question by:dkilby
  • 2
4 Comments
 
LVL 18

Expert Comment

by:tusharashah
ID: 11802640
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
0
 

Author Comment

by:dkilby
ID: 11802770
Tried that and it didn't work
0
 
LVL 3

Accepted Solution

by:
travisjhall earned 500 total points
ID: 11806406
You are probably better off fixing the "potentially dangerous" value rather than turning off the warning about it, anyway.

I'm no ASP.NET expert, and you haven't posted enough of your code for me to really know much about what is going on, but it looks to me like you've managed to write a lot more than "12" into your variable. It might be that the Response.Write call that you've given us is followed by another Response.Write call that has appended stuff in an inappropriate way.

Perhaps you should show us more of your code, so we might be able to spot what is going on.
0
 
LVL 3

Expert Comment

by:travisjhall
ID: 11876245
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).
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Path to Python 9 128
VBSCRIPT string remove all characters to the right after extension 4 66
ejb wildfly example 2 20
AutoIncrement column based of FK 11 55
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

839 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