The HTTP verb POST used to access path is not allowed

前端 未结 3 1636
青春惊慌失措
青春惊慌失措 2020-12-22 03:34

I am not using URL Rewriting, my app works fine until I try to hit a .PDF file or even a .TXT file via a link that I have dynamically generated into the PostBackUrl of a Lin

3条回答
  •  既然无缘
    2020-12-22 03:47

    When you use the PostBackUrl property of a LinkButton there is a POST verb being used. Quote from the documentation:

    The PostBackUrl property allows you to perform a cross-page post using the LinkButton control. Set the PostBackUrl property to the URL of the Web page to post to when the LinkButton control is clicked. For example, specifying Page2.aspx causes the page that contains the LinkButton control to post to Page2.aspx. If you do not specify a value for the PostBackUrl property, the page posts back to itself.

    So I would recommend you using a normal hyperlink:

    ">foo.pdf
    

提交回复
热议问题