473,544 Members | 1,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10491
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=homedn g.asp>go to Finance</a>

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

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

<%
for i=1 to Request.Form.Co unt
Session(Request .Form.Key(i))=R equest.Form(i)
'Response.write ( i & ": " & Request.Form.Ke y(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.Content s
Response.Write( x & "=" & Session.Content s(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
8518
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 unique session ID in a cookie and referencing the SSN from the Session ID would be the correct way to do this. But since we have two separate servers,...
1
1789
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 accessible. I have checked it with IE 6. And in abc.aspx, session
14
2043
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 described below occurs for 0.1% of users, and so far I've only seen it on IE 6.0. My ASP.NET website is set up like this: 1. Logon page - Collect...
0
989
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 when I executed the code, the Session variable values were not being written. Any clues... Vibhu
2
2191
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 contains a button on click of which i call an applet to do some work. Once the applet finishes its job it calls another aspx page to continue. But the...
3
1817
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 another aspx page can´t see the updates, this happends only if i set the sessionstate mode to stateserver, with inproc mode all works fine, i use...
22
14856
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 done in 3 steps: Step 1. Normal http login page. Step 2. A page called login.php that takes the posted username, stores it as $_SESSION, and registers...
0
7426
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7610
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7381
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7712
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5914
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4920
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1843
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
667
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.