I’ve a link button:
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" Text="View" PostBackUrl='<%# Eval("Name", "../Image/Uploaded/{0}") %>'>
The Eval value is based on what image is loaded to the formview.
For example, I want to view the Panorama.jpg image and while I am clicking that linkbutton, the error shows:
The HTTP verb POST used to access path '/Image/Uploaded/Panorama.jpg' is not allowed.
I’ve tried using this code to solved but it is the same:
Dim imgUplPath As String = Request.PhysicalApplicationPath & "../Image/Uploaded/"
Dim f2 As New FileIOPermission(FileIOPermissionAccess.Read, imgUplPath)
Try
f2.Demand()
Catch s As SecurityException
Console.WriteLine(s.Message)
End Try
Anyone can help me, please? Thanks a lot
You are trying to do a
POSTrequest to an image resource –jpg. That’s not valid; there’s no handler forPOSTrequests forjpgresources.Perhaps what you are looking for is to link right to the image URL, instead of using the
PostBackUrlof aLinkButton