?
Solved

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

Posted on 2004-08-14
4
Medium Priority
?
776 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Six Sigma Control Plans
Loops Section Overview

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