Chrome fails to load resources when using Server.Transfer or Response.Redirect

633 views Asked by At

This is not a "why don't my resources load in Chrome" question.

I have a site in development (VS 2015 - C#). My site starts off like this:

  1. Default.aspx loads
  2. Server.Transfer("view.aspx");

This works fine and all resources (jquery, bootstrap, css files, etc...) load up in I.E. but fail to load in Chrome.

I have also tried Response.Redirect("view.aspx") and get the same results.

I am passing no content from default.aspx to view.aspx, so there is nothing to preserve there.

If I set the "View.aspx" page to be the startup page, both I.E. and Chrome work fine. This would seem to indicated that my page/resources/references/etc. are fine.

So, why does Server.Transfer and/or Response/Redirect create a failure to load resources under Chrome but direct navigation seems to be fine?

2

There are 2 answers

4
Vegas Rico On

Try to open developers tools in your web-browser (Chrome) by pressing F12 key. There must be tab "Network". Look there if you got some errors on response.

0
cherishty On

I also suffering this on Server.Transfer + Chrome , and my error strace shows as below:

Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> 
System.Web.HttpException (0x80004005): Error executing child request for XXX

  at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, 
TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, 
VirtualPath 
path, VirtualPath filePath, String physPath, Exception error, String 
queryStringOverride) 
  at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, 
Boolean preserveForm) 
  at System.Web.HttpServerUtility.Transfer(String path) 

However, It works fine if I use Response.Redirect, and in my research, this issue may result from losing Context inform.