Sharing ASP session variables with ASP.Net using HTTPWebRequest

  • Thread starter Thread starter Hardik Shah
  • Start date Start date
H

Hardik Shah

Hi,

I am calling an ASP.Net page from an ASP classic application but need
the .Net page to have access to ASP classic's session variables. I am
using HTTPWebRequest to call ASP classic page which could then return
the session values. But the values are always blank. If I do a
Response.Redirect() to call the ASP page, it returns the values okay.
But I cannot do a Response.Redirect() as I just need to access some
session variables and retain the control with the .net page.

Not sure why HTTPWebRequest is not returning the values. Any ideas?

May be I can forego HTTPWebRequest and use hidden textboxes on the ASP
page that calls the .Net page. Is there a way for .Net page to refer
to those textboxes on ASP page?

Thanks a bunch!
Hardik
 
There is no single great way to share session state between ASP and ASP.NET.
But that doesn't mean you don't have options.

Here are some common ways:
* Store the data in a common database
* Pass data from page to page on the QueryString
* Store the data in cookies
* Use a 3rd party session sharing component
(Here's one:
http://www.consonica.com/solutions/dotnet/statestitch/index.html)
* Use COM Interop to provide an object that both sides can access that
handles the data.
Here's an example of the latter:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/ConvertToASPNET.asp
 
Steve,

Thanks for your response. I was wondering if HTTPWebRequest should
work too. I just found that when calling my ASP page using
HTTPWebRequest, its not using the same session ID as my ASP
application which explains why its not returning the session values.
But Response.Redirect uses the same session ID. Is there a way I can
set HTTPWebRequest to use a particular session ID?

I am evaulating your other ideas.

Thanks!
Hardik
 
Back
Top