473,396 Members | 1,836 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.

Passing Session Variables from ASPX to ASP application

Hi,

I have an ASPX application from which I need to pass session variables
(ex:username and password) to an ASP Page. How do I do this? Could you pls
give a n example code for both aspx and asp.

Thanks!

Jan 18 '06 #1
5 10476
GeRmIc,
Here is one way:

http://www.eggheadcafe.com/articles/20021207.asp

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"GeRmIc" wrote:
Hi,

I have an ASPX application from which I need to pass session variables
(ex:username and password) to an ASP Page. How do I do this? Could you pls
give a n example code for both aspx and asp.

Thanks!

Jan 18 '06 #2
Thanks Peter. How do I do it the other way? Passing passwords from an ASPX
page to classic ASP page.

Thanks again!

"Peter Bromberg [C# MVP]" wrote:
GeRmIc,
Here is one way:

http://www.eggheadcafe.com/articles/20021207.asp

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"GeRmIc" wrote:
Hi,

I have an ASPX application from which I need to pass session variables
(ex:username and password) to an ASP Page. How do I do this? Could you pls
give a n example code for both aspx and asp.

Thanks!

Jan 19 '06 #3
geRmic,
go back and read the article again. The download includes code in both C#
and VB.NET to pass session variables in both directions.
Peter.
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"GeRmIc" wrote:
Thanks Peter. How do I do it the other way? Passing passwords from an ASPX
page to classic ASP page.

Thanks again!

"Peter Bromberg [C# MVP]" wrote:
GeRmIc,
Here is one way:

http://www.eggheadcafe.com/articles/20021207.asp

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"GeRmIc" wrote:
Hi,

I have an ASPX application from which I need to pass session variables
(ex:username and password) to an ASP Page. How do I do this? Could you pls
give a n example code for both aspx and asp.

Thanks!

Jan 19 '06 #4
Hi Peter,

I'm still facing some problems with ASPX to ASP password passing. Could you
pls help....

In ASPX page
--------------
<%
String nameaspx = (String) Session["UserName"];
Session["nameasp"] = nameaspx; %>

So, I am passing nameasp to the asp page which is called by a hyperlink and
not a submit/post.

Now, how do i retreive nameasp in the asp page?

Thanks a ton!!
Mar 7 '06 #5
Example files
==========
finance2.aspx
---------------
<% Session["uName"] =(String) Session["UserName"] %>;
<a href=temp.aspx?destpage=homedng.asp>go to Finance</a>

temp.aspx
-----------
<TITLE>test.aspx</TITLE>
<script language="C#" runat="server">
private void Page_Load(object sender, EventArgs e){
Response.Write( "<form name=t id=t action=../finance/icrfin/homedng.asp
method=post>" );
foreach(object it in Session.Contents)
{
Response.Write("<input type=hidden name=" + it.ToString());
Response.Write( " value=" + Session[it.ToString()].ToString() + " >");
}
if (Request.QueryString["target"] !=null)
Response.Write("<input type=hidden name=target value="+"homedng.asp"+">");
Response.Write("</form>");
Response.Write("<scr"+"ipt>t.submit();</scr"+"ipt>");
}
</script>

temp.asp
---------

<%
for i=1 to Request.Form.Count
Session(Request.Form.Key(i))=Request.Form(i)
'Response.write( i & ": " & Request.Form.Key(i) & ": " & Request.Form(i) &
"<BR>")
next
'Response.End
Server.Transfer(Session("../finance/icrfin/homedng.asp"))
%>

homedng.asp (this is the final page in which i want the username from the
first page to appear)
--------------
<%
for each x in Session.Contents
Response.Write(x & "=" & Session.Contents(x) & "<br />")
next
%>

This code works perfectly on localhost but when put on a public webserver
where many users access it simultaneously, it fails to get the user name got
in the first page through windows authentication to be passed to the
homedng.asp page.

Pls advice. Thanks!
Mar 8 '06 #6

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

Similar topics

4
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a...
1
by: sumit | last post by:
hi, I am opening a popup using window.showModalDialog ('abc.aspx','','dialogWidth:1200px;dialogHeight:800px;left: true;help:no;resizable:yes;');"); In abc.aspx, session variables should be...
14
by: Michael Carr | last post by:
I have an intermittent problem that occurs on a very small number of browsers that access my website. The strange thing is this: my site works perfectly for 99.9% of browsers. The behavior...
0
by: Vibhu Bansal | last post by:
http://www.eggheadcafe.com/articles/20021207.asp I downloaded the sample from the above mentioned URL for passing Session variables from ASP to ASPX (actually I require the reverse of it) but...
2
by: ramendra | last post by:
Hello, I am having some trouble with passing session variables from one aspx page to another aspx page through an applet. Let me clarify the problem more ... I have an aspx page which...
3
by: panic | last post by:
hello, In my web app when some button is clicked, a new thread is created to import data and that thread creates some threads too, inside those threads some session variables are updated, but...
22
by: K. A. | last post by:
I have two servers at work, 'A' for testing and development, and server 'B' for production. On server A, I wrote a PHP test code to login users then direct them to a personalized page. This is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.