Sharing ASP session variables with ASP.Net using HTTPWebRequest

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
 
S

Steve C. Orr [MVP, MCSD]

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
 
H

Hardik Shah

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top