我有一个链接按钮:
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" Text="View" PostBackUrl='<%# Eval("Name", "../Image/Uploaded/{0}") %>'>
Eval 值基于加载到 formview 的图像。
例如,我想查看 Panorama.jpg 图像,当我单击该链接按钮时,错误显示:
The HTTP verb POST used to access path '/Image/Uploaded/Panorama.jpg' is not allowed.
我试过用这段代码来解决,但它是一样的:
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
任何人都可以帮助我,好吗?非常感谢