Last post Nov 20, 2008 11:18 AM by smayekar
Nov 14, 2008 05:47 PM|smayekar|LINK
I am trying to Migrate a 2003 application to VS 2005. I am using Web application Projects for this migration.
The application works good in 2003 on XP
The VS 2005 version is setup on Windows Vista. The project compiles fine when migrated using web applications project.
Now the Issue:
The Solution contains two projects Ethicsweb and EthicsCore. The EthicsCore is the dll being referred in Ethicsweb.
There is a class EthicsUtils in the EthicsCore project having a method Transfer as follows
public static void Transfer(HttpContext context, string url, bool preserveForm)
This method redirects to the page EthicsHistory.aspx.
The inheritance Heirarchy for this page is as follows
I would want the context to be the same when I do a context.Server.Transfer. The Context is being used to store several parameters.
This behavior is fine in 2003, but in 2005 this is not maintained.
I have tried the website project model and it similarly runs into the same issue.
Please let me know what/where the issue could be.
Nov 19, 2008 05:02 AM|Thomas Sun – MSFT|LINK
Firstly, please install Visual Studio 2005 Service Pack 1 Update for Windows Vista from
Based on my experience, we sometimes cannot get the value of HttpContext from Class Library project. I suggest you only use it in your website and redirect user basing on the Class Library's return value.
You also can refer to Working With HttpContext.Current (http://www.odetocode.com/Articles/112.aspx).
I look forward to hearing from you.
Nov 20, 2008 11:18 AM|smayekar|LINK
I am still analyzing what could go wrong in the code. I installed web application project and tried debugging the code in that. I found that there is a context transfer properly done in the code. when the context transfer is done i receive a proper context
on the page. But once it get out of the declaration on that page the control flows to executing the base classes.
i.e from EthicsHistory to EthicsTabs and so on. The base class declarations and contructor get executed first and then the control comes back to the original page that is EthicsHistory.
Now when coming back to EthicsHistory the context gets lost in EthicsTabs as it passes control to the Tabstrip ascx control being declared there. once the flow control goes to tabstrip.ascx control the context gets lost.
I am not sure if this is architectural issue or issue with the usercontrols.
also in another page during debugging i found that the context is maintained in the tabstrip.ascx control. I am totally lost as I am not able to figure out where to put the fix or do the change.
also one more thing is when i deploy the code on XP machine having .net 2.0 I still have the same issue. so installing Service pack on vista is surely not solving the problem.
Is there a way I could trace the whole inheritance flow so as to find out where the control flows.