CipherIS
asked on
ASP.NET - A potentially dangerous Request.Form value was detected from the client
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.
Thanks
<asp:LinkButton ID="lnkDownloadDoc" runat="server"
ImageID='<%#DataBinder.Eval(Container, "dataItem.imageId")%>'
OnClick="lnkDownloadImage_Click" >
<%#DataBinder.Eval(Container, "dataItem.imageId")%>
</asp:LinkButton>
Thanks
ASKER
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
Any ideas?
DocIDIssue.jpg
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.