473,382 Members | 1,717 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,382 software developers and data experts.

Pass a Session Variable from ASP.NET to ASP

I have an application where a session variable is set in an ASPX page, The
process calls an ASP page and when in that page the session variable appears
to be null. How can I pass a session variable to an ASP page?

Wayne
Nov 18 '05 #1
3 5127
You can't directly. ASP and ASP.NET use different engines and do not share
any application or session data. You will have to pass the value manually
in a cookie, querystring, hidden form field, database or file of your own.
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:ux*************@tk2msftngp13.phx.gbl...
I have an application where a session variable is set in an ASPX page, The
process calls an ASP page and when in that page the session variable appears to be null. How can I pass a session variable to an ASP page?

Wayne

Nov 18 '05 #2
Scott;

Thanks for the response. I suspected something like that and I tried to add
the Session value to a querystring but I cannot find the correct syntax. I
have the following code for a hyperlink:

<asp:HyperLink id="XX" runat="server"
NavigateUrl = '<%#
"http://wengert.org/evaljudge.asp?name=" +
DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption=" +
DataBinder.Eval(Container.DataItem,"Caption")%>'
Text = "Edit" >
</asp:HyperLink>

I'd like to add something like this

<asp:HyperLink id="XX" runat="server"
NavigateUrl = '<%#
"http://wengert.org/evaljudge.asp?name=" +
DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption=" +
DataBinder.Eval(Container.DataItem,"Caption") + "&userid=" +
Session("ActiveUser") %>'
Text = "Edit" >
</asp:HyperLink>

but that doesn't work. How can I add a session variable to that hyperlink?

TIA

Wayne

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
You can't directly. ASP and ASP.NET use different engines and do not share any application or session data. You will have to pass the value manually
in a cookie, querystring, hidden form field, database or file of your own.
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:ux*************@tk2msftngp13.phx.gbl...
I have an application where a session variable is set in an ASPX page, The process calls an ASP page and when in that page the session variable

appears
to be null. How can I pass a session variable to an ASP page?

Wayne


Nov 18 '05 #3
I would take a different approach. Instead of trying to add logic to your
HTML, I would add it to the code-behind (which is the preferred way in
..NET).

Simply place your asp:hyperlink in the aspx page and then in the
code-behind, determine its NavigateURL value

Sub Page_Load()
Dim JudegName as String = GET DATA VALUE
Dim Caption as String = GET DATA VALUE
XX.NavigateURL = "http://wengert.org/evaljudge.asp?name=" + "JudgeName"
+ "&caption=" + "Caption"
End Sub
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
Scott;

Thanks for the response. I suspected something like that and I tried to add the Session value to a querystring but I cannot find the correct syntax. I
have the following code for a hyperlink:

<asp:HyperLink id="XX" runat="server"
NavigateUrl = '<%#
"http://wengert.org/evaljudge.asp?name=" +
DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption=" +
DataBinder.Eval(Container.DataItem,"Caption")%>'
Text = "Edit" >
</asp:HyperLink>

I'd like to add something like this

<asp:HyperLink id="XX" runat="server"
NavigateUrl = '<%#
"http://wengert.org/evaljudge.asp?name=" +
DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption=" +
DataBinder.Eval(Container.DataItem,"Caption") + "&userid=" +
Session("ActiveUser") %>'
Text = "Edit" >
</asp:HyperLink>

but that doesn't work. How can I add a session variable to that hyperlink?

TIA

Wayne

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
You can't directly. ASP and ASP.NET use different engines and do not

share
any application or session data. You will have to pass the value manually
in a cookie, querystring, hidden form field, database or file of your own.

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:ux*************@tk2msftngp13.phx.gbl...
I have an application where a session variable is set in an ASPX page,

The process calls an ASP page and when in that page the session variable

appears
to be null. How can I pass a session variable to an ASP page?

Wayne



Nov 18 '05 #4

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

Similar topics

4
by: Gerhard Pretorius | last post by:
ON Win 2003 IIS6, Since yesterday, (12 Aug 2003) for some strange reason, (after installing WindowsServer2003-KB823980-x86-ENU.exe) I cannot pass the Request object to to VB COM DLL. I have...
5
by: eagletender | last post by:
I am simply trying to pass a variable to another page. I know my second page can do Request("str") to retrieve that variable, but how do I pass it in the first place? I tried...
3
by: Kelvin | last post by:
Hi All, Please help. How to pass traditional asp session variable to C# session variable ?? Please advise. Thanks
1
by: crjunk | last post by:
I've got an aspx page that allows the user to select different options whenever they want to run a report. On this page, I have added an additional text box for the user to enter in comments about...
3
by: Wayne Wengert | last post by:
I have an application where a session variable is set in an ASPX page, The process calls an ASP page and when in that page the session variable appears to be null. How can I pass a session variable...
4
by: acool | last post by:
I want the ability to fill in the public properties of a given class in a webform pump that class into a session variable and then recreate a new instance of that class in order to grab those same...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
4
by: simon | last post by:
hello. relatively new to vb.net, i'm using VS 2003 and .net 2.0 i have a web app that i'm i have a user control that displays a simple 1 row table as the header of the page. the user control...
1
by: aperez | last post by:
Hi, I need to pass a session variable from an ASP.NET v1.1 page to a v2.0 page, but haven't been able to do it. The reason is because I need to embed the 1.1 page in my intranet portal tool so I...
3
by: hon123456 | last post by:
Dear all, I have a session variable session("loginid) which can be passed from A.asp to B.asp. Then In B.asp I have a hyperlink to C.asp e.g. < A href..C.asp>. The session variable cannot be...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.