Sys.WebForms.PageRequestManagerServerErrorException: .... 从服务器返回的状态代码为:404

发布于 2024-08-23 21:56:32 字数 741 浏览 1 评论 0原文

我看过一些关于这个问题的帖子,但没有一篇专门针对我的问题,而且我不知道需要做什么来调试这个问题。

我在 aspx 页面上有一些组合框,当我从第一个值中选择一个值时,它会用值填充第二个值,依此类推,用第三个和第四个值填充。这没有任何问题,直到我在组合框周围包裹一个 asp.net UpdatePanel 并尝试“ajaxify”整个过程,这样页面就不会到处乱跳。我得到的确切错误是:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404

需要注意的事项:

  1. 我正在使用 URL 重写 - 这就是我认为导致问题的原因
  2. 每当我第二次选择一个选项时,就会发生错误。这意味着我可以从第一个组合框中选择一个值并得到相同的错误(因此它发生在第二个回发上 - 无论它来自哪个组合框)。

我尝试在 scriptmanager 上设置 EnablePartialRendering="false" 但正如我所说,它在不使用 ajax 时有效,所以我不知道如何调试该问题。

我的服务器是运行 IIS 的 Windows 2008与 ASP.NET 2.0。

我非常感谢您的帮助,

提前致谢。

I have seen a few posts regarding this issue but not one specific to my problem and I have no ideas as to what I need to do to debug this.

I have some combo boxes on an aspx pages, when I select a value from the first one, it fills the second with value and so on with the third and fourth. This works with no problems until I wrap an asp.net UpdatePanel around the combo boxes and try to "ajaxify" the whole process so the page isn't dancing around. The exact error I get is:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404

Some things to note:

  1. I am using URL rewriting - This is what I think is causing the problem
  2. The error will occur whenever I choose a selection for a SECOND time. This means that I could select a value from the first combo box and get the same error (so it is happening on the second postback - No matter which combo box it's from).

I have tried setting the EnablePartialRendering="false" on teh scriptmanager but as I said, it works when not using ajax, so I don't know how to debug the issue.

My server is Windows 2008 running IIS& with ASP.NET 2.0.

I would really appreciate your help

Thanks in advance.

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

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

发布评论

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

评论(2

淡紫姑娘! 2024-08-30 21:56:33

好吧,我已经设法找到解决方案......发布后几分钟。

我使用 HTTPWatch 来获取请求发布到的 URL。这表明 URL 已附加到每个帖子的现有 URL,而不是覆盖。我在页面顶部使用了一些 JavaScript 将表单 URL 设置为窗口位置:

Sys.Application.add_load(function()
{
    var form = Sys.WebForms.PageRequestManager.getInstance()._form;
    form._initialAction = form.action = window.location.href;
});

这对它进行了排序。

希望它对其他人有帮助。

Ok, I have managed to find a solution ... minutes after posting.

I used HTTPWatch to get the URL the request was being posted to. This showed me the URL was Appending to the existing URL each post and not overwriting. I used some JavaScript at the top of my page to set the forms URL to the window location:

Sys.Application.add_load(function()
{
    var form = Sys.WebForms.PageRequestManager.getInstance()._form;
    form._initialAction = form.action = window.location.href;
});

This sorted it.

Hope it helps someone else.

对你的占有欲 2024-08-30 21:56:33

如果使用,请使用 Response.Redirect() 而不是 Response.Transfer()。

Use Response.Redirect() instead of Response.Transfer() if you use.

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