发布到默认页面

发布于 2024-09-11 22:57:30 字数 381 浏览 3 评论 0原文

为什么不能在 ASP.NET 上执行 HTTP.Post 到默认页面 我有一个 default.aspx 文件,当外部实用程序向

http://{ip}/网站名称

我希望实际的帖子将发布到此页面:

http://{ip}/WebSiteName/Defualt.aspx

http://{ip}/WebSiteName/Handler.ashx

我认为,如果我让它发布到第一个网址,我将能够重新创建一个新帖子到第二个网址 - 这是我最初的目标。

谢谢, 伊泰

Why is it not OK to do a HTTP.Post to the default page on ASP.NET
I have a default.aspx file that i want to be accessed when an external utility do a post to the

http://{ip}/WebSiteName

I want that the actual post will be to this page:

http://{ip}/WebSiteName/Defualt.aspx

or

http://{ip}/WebSiteName/Handler.ashx

I think that if i get it to post to the first url, i will be able to recreate a new post to the second url - which is my original target.

Thanks,
Itay

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

溺渁∝ 2024-09-18 22:57:30

查看此知识库文章:http://support.microsoft.com/kb/216493

HTTP 错误
405 方法不允许

对于请求所标识的资源,不允许使用请求行中指定的方法。请确保您为所请求的资源设置了正确的 MIME 类型。

如果满足以下条件,则会出现此问题:

* You do not specify the file name. For example, you do not specify http://Server/Web/.
* The Scripting Object Model (SOM) is enabled.
* A DTC event is called.

这是 IIS 4 和 5 中的已知错误,但在 6 中已得到纠正。

Check out this KB article: http://support.microsoft.com/kb/216493

HTTP Error
405 Method Not Allowed

The method specified in the Request Line is not allowed for the resource identified by the request. Please ensure that you have the proper MIME type set up for the resource you are requesting.

This problem occurs if the following conditions are true:

* You do not specify the file name. For example, you do not specify http://Server/Web/.
* The Scripting Object Model (SOM) is enabled.
* A DTC event is called.

It is a known bug in IIS 4 and 5 but corrected in 6.

智商已欠费 2024-09-18 22:57:30

您可以将 IIS 查找的第一个页面设置为 index.aspx,然后在该页面上执行 Response.Redirect("~/Default.aspx", true) ,这应该会重现您需要的内容。

You could set your first page IIS looks for to be index.aspx, then on that page do a Response.Redirect("~/Default.aspx", true) and that should reproduce what you need.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文