469,954 Members | 1,755 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,954 developers. It's quick & easy.

Sharing ASP session variables with ASP.Net using HTTPWebRequest

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
Nov 18 '05 #1
3 2726
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/d...tch/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/de...rtToASPNET.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Hardik Shah" <hg********@InvalidEmail.com> wrote in message
news:m1********************************@4ax.com...
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

Nov 18 '05 #2
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

On Tue, 9 Dec 2003 16:50:49 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
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/d...tch/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/de...rtToASPNET.asp


Nov 18 '05 #3
No, I don't think HTTPWebRequest would work.

"Hardik Shah" <hg********@InvalidEmail.com> wrote in message
news:c8********************************@4ax.com...
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

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Karsten Grombach | last post: by
4 posts views Thread by Cowboy \(Gregory A. Beamer\) | last post: by
3 posts views Thread by grooby | last post: by
3 posts views Thread by Selden McCabe | last post: by
4 posts views Thread by abcd | last post: by
5 posts views Thread by gom | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.