473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ASP Session Vars to ASP.Net

JDP
First off let me say that

http://msdn.microsoft.com/library/de...rttoaspnet.asp

would not work as I see it. Right off, I can't have a cookie.

Anyway, another solution suggests using hidden form fields only helps me to know
that there is a way, I don't know how to pass a hidden form field from my clasic
ASP to ASP.Net

So does anyone have a down and dirty example of ASP passing its session to an
ASPX page using any reliable method other than cookies?

My ultimate goal....

.....is to use SQLRS and to do so, I expect to have to lauch from .Net.

This is an intranet so there is little security, however when my users enter
their login on the default.asp and logs in, querys are run that retrieve the
appropriate security information and stores them in the ASP seesion vars,
loading them from page to page into hidden form fields.

Many of the ASP pages are called and if the session vars are populated
automatically call the subsequent pages, depending on security depositing the
user at the appropriate page or Crystal report rendered.

TIA

JeffP...
Nov 18 '05 #1
6 1596
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
"JDP@Work" <JP*********@sbcglobal.net> wrote in message
news:eD*****************@TK2MSFTNGP10.phx.gbl...
First off let me say that

http://msdn.microsoft.com/library/de...rttoaspnet.asp

would not work as I see it. Right off, I can't have a cookie.

Anyway, another solution suggests using hidden form fields only helps me
to know
that there is a way, I don't know how to pass a hidden form field from my
clasic
ASP to ASP.Net

So does anyone have a down and dirty example of ASP passing its session to
an
ASPX page using any reliable method other than cookies?

My ultimate goal....

....is to use SQLRS and to do so, I expect to have to lauch from .Net.

This is an intranet so there is little security, however when my users
enter
their login on the default.asp and logs in, querys are run that retrieve
the
appropriate security information and stores them in the ASP seesion vars,
loading them from page to page into hidden form fields.

Many of the ASP pages are called and if the session vars are populated
automatically call the subsequent pages, depending on security depositing
the
user at the appropriate page or Crystal report rendered.

TIA

JeffP...

Nov 18 '05 #2
"JDP@Work" <JP*********@sbcglobal.net> wrote in
news:eD*************@TK2MSFTNGP10.phx.gbl:
So does anyone have a down and dirty example of ASP passing its
session to an ASPX page using any reliable method other than cookies?


Here's what I use:

http://www.asp101.com/articles/sidne...te/default.asp
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #3
JDP
Lucas, I don't need to go bi-directional, and I knew that I could use MSSQL to
store all my session NV's, its just a bunch of network round-trips on an already
overloaded network.

Further we're getting heat from the official IT Dev Dept and they want Alpha,
Beta and Load testing data prior to going live, egads, I'm trying to have a
light footprint. The only thing saving us right now is that ITDev isn't
compliant with their own standards so we've got a little le-way.

How'a bout this little diddy?

I think this loaded using the Form or QueryString. Perhaps someone could shed
some more light here.

ASPTransfer.aspx

....generic script omitted...
<%
' Copy all Session variables from the Request beginning with "S" (From ASP)
into
' our .NET session.
' Copy all request variables into .NET Request variables for our next post.
Dim itemSession as Object
Dim i as Integer = 1
Dim iCount as Integer = Request.Form.Count - 1
For i = 0 to iCount
if Left(Request.Form.GetKey(i),1) = "S" then
Session.Contents.Add(Request.Form.GetKey(i), Request.Form(i))
Response.Write(Session.Contents.Count & "<BR>" & vbCRLF)
else
Response.Write("<input type=hidden name=" & Mid(Request.Form.GetKey(i),2) &
_
" value=" & Request.Form(i) & ">")
end if
Next
%>
.... script truncated....

TIA
JeffP....

"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn**************************@140.99.99.130...
"JDP@Work" <JP*********@sbcglobal.net> wrote in
news:eD*************@TK2MSFTNGP10.phx.gbl:
So does anyone have a down and dirty example of ASP passing its
session to an ASPX page using any reliable method other than cookies?


Here's what I use:

http://www.asp101.com/articles/sidne...te/default.asp
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 18 '05 #4
"JDP@Work" <JP*********@sbcglobal.net> wrote in
news:ea*************@TK2MSFTNGP10.phx.gbl:
I think this loaded using the Form or QueryString. Perhaps someone
could shed some more light here.

ASPTransfer.aspx

...generic script omitted...
<%
' Copy all Session variables from the Request beginning with "S"
(From ASP)
into
' our .NET session.
' Copy all request variables into .NET Request variables for our
next post. Dim itemSession as Object
Dim i as Integer = 1


Did the script you write work?

I think it would be better if you had two pages.

Page 1 - ASP - Copy stuff to Form Variable
Page 2 - ASP.NET - Copy Form Variable to Session

You maybe able to save a redirect by using Server.Transfer on Page 1.
Not sure if you Server Transfer from ASP to ASP.NET tho.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #5
JDP@Work wrote:

Anyway, another solution suggests using hidden form fields only helps me to know
that there is a way, I don't know how to pass a hidden form field from my clasic
ASP to ASP.Net


Well, maybe not so neat but it could be a 'solution':
Dump all your data in hidden fields with a <form> tag that has it's
action property set to a aspx page. In that aspx page you can use
Request.Form to retrieve the values.

//Rutger
Nov 18 '05 #6
JDP
Lucas, Did it work? Kinda, I'm still getting unknown errors launching my working
Crystal report, so I know something is wrong, debugging by writing my params is
still in process.

I think that the form fields may be the way to go as Rutger has suggested, but I
have little confidence because non of the other sites and MSDN suggest this
method.

TIA

JeffP....

"Rutger Smit" <ru********@hotmail.com> wrote in message
news:10*************@corp.supernews.com...
JDP@Work wrote:

Anyway, another solution suggests using hidden form fields only helps me to know that there is a way, I don't know how to pass a hidden form field from my clasic ASP to ASP.Net


Well, maybe not so neat but it could be a 'solution':
Dump all your data in hidden fields with a <form> tag that has it's
action property set to a aspx page. In that aspx page you can use
Request.Form to retrieve the values.

//Rutger

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: james | last post by:
I am new to php and need some help getting the session variables into include files. (after-thought, Sorry for the drawn out post but I really, really need help....;) Here's what I'm doing.. ...
13
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 ...
8
by: ndsoumah | last post by:
hello guys I'm trying to get access to variables I put in a session variable from another page and it fails... here's the exact situation main file page1.php
9
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk...
1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
19
by: Paul Yanzick | last post by:
Hello, I am trying to develop a book tracking application for my capstone in school, and am running into a problem. The application is an ASP.Net application written in C#. The first page you...
3
by: Mark | last post by:
Ok, I know that .net inherently does not share session data across asp.net projects, but is there any decent work around to this. We already have a big chunk of our application using the asp.net...
5
by: VB Programmer | last post by:
I often use session variables to store the user's security level, and other important info. How secure are session variables? Can someone decrypt it and get the information? (This would be...
13
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i...
2
by: Jeff | last post by:
....still new to .net 2005 using VB. Do I understand correctly that the value of a session variable is actually stored in the server's ram, but relies on the asp.net session ID cookie that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.