About transferring session variables...

  • Thread starter Hanumant Ganpat
  • Start date
H

Hanumant Ganpat

I am working on webdevelopment using ASP.NET with C#. I am trying to
transfer page from one application to another application page.I have to
access session variables from last application into new transferred
page.How can I do?
If any one have any idea Please help me....!!
 
H

Hillbilly

//Page1.aspx
Session["FirstName"] = FirstNameTextBox.Text;

//Page2.aspx
string firstName = Session["FirstName"].ToString();

--or--

//Page1.aspx
Session["NumberOfBitchyGirlfriends"] = 3;

//Page2.aspx
int bitchbitchbitch = (int)Session["NumberOfBitchyGirlfriends"];

NOTE: since you may --literally-- mean you want to transfer data from one
application to another we cannot use Application2 to access the Session
generated in Application1. If Application2 is in the same domain as
Application1 (mywebsite.com for example) we can then write a cookie in
Application1 to mywebsite.com that contains the Session variable and then
read the cookie from Application2 that also exists in the same domain
mywebsite.com; if not the same domain use the database or an XML file to
store the data as required.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top