Solved

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

Posted on 2013-06-17
4
560 Views
Last Modified: 2013-07-15
I am using a LinkButton.  When the user clicks on the LinkButton the above error occurs.  Any way to avoid the error?  I can't put pagevalidation = false.

<asp:LinkButton ID="lnkDownloadDoc" runat="server" 
      ImageID='<%#DataBinder.Eval(Container, "dataItem.imageId")%>'
      OnClick="lnkDownloadImage_Click" >
      <%#DataBinder.Eval(Container, "dataItem.imageId")%>
</asp:LinkButton>

Open in new window


Thanks
0
Comment
Question by:CipherIS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 39254804
Could you send the contents of "DataBinder.Eval(Container, "dataItem.imageId")"?

Any way, the link button control values cannot contain the following characters: "<", ">", etc. as explained in the link below:
http://www.dreamincode.net/forums/topic/234664-potentially-dangerous-requestform-value-was-detected-from-the-client/

Possible solutions:
1) Disable validation, check:
http://stackoverflow.com/questions/9130186/a-potentially-dangerous-request-form-value-was-detected-from-the-client
2) Avoid using these characters on your html markup. Encoding (HtmlEncode) may not work because you are using these characters at ImageID.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 39256750
I've attached a copy of the data being passed.  I am using a repeater.  In the repeater I have a LinkButton.  The linkbutton is useing column imageStoreID.  That field is the one causing the error.  It does not make sense why that would be the issue.  

Any ideas?
DocIDIssue.jpg
0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 39257945
The data looks good, thus the link control is not the problem here, you have these characters elsewhere in the page that are being transmitted as part of the post back request, please post markup/code of the whole page, (e.g. lnkDownloadImage_Click)
The way I will go about it is I will start removing markup element until you find the culprit control markup causing this issue. Antoher way is to create just a new page with the repeater and the link button and see if you still have the same error.
0
 
LVL 11

Accepted Solution

by:
SAMIR BHOGAYTA earned 500 total points
ID: 39265379
hi. you have to set this value on .aspx page first line

<%@ Page Language="VB" AutoEventWireup="false" CodeFile=".vb" EnableEventValidation="false" ValidateRequest=true  Inherits="PageName" %>

If it is not solved please try to change true/false.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

690 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