English 中文(简体)
Sys.WebForms.PageRequestManagerServerErrorException: .... The status code returned from the server was: 404
原标题:

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.

最佳回答

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.

问题回答

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





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签