How can a different web page (aspx) access anothers session variab

J

JB

Hello Community

Using ASP.NET, C# and Sql Server I produce a report by declaring session
variable and passing the variables to a report like so:

Session["ssnum"] = varssnum;
Session["lname"] = varlname;
Session["fname"] = varfname;
Session["dob"] = vardob;
Session["phone"] = varphone;

ResponseHelper.Redirect("lFolder/reports.aspx?varssnum;=" +
row.Cells[1].Text +
"&varlname=" + row.Cells[2].Text + "&varfname=" + row.Cells[3].Text +
"&vardob=" + row.Cells[4].Text + "&varphone=" + row.Cells[5].Text, "_blank",
"width=800, height=1000, fullscreen=no");

The problem is after that I click on another web page (aspx) that needs
to use those same session variables.

Since they are session variable is there anyway that the other web page
can access those session variables?

Thanks
Jeff
 
M

Mr. Arnold

JB said:
Hello Community

Using ASP.NET, C# and Sql Server I produce a report by declaring session
variable and passing the variables to a report like so:

Session["ssnum"] = varssnum;
Session["lname"] = varlname;
Session["fname"] = varfname;
Session["dob"] = vardob;
Session["phone"] = varphone;

ResponseHelper.Redirect("lFolder/reports.aspx?varssnum;=" +
row.Cells[1].Text +
"&varlname=" + row.Cells[2].Text + "&varfname=" + row.Cells[3].Text +
"&vardob=" + row.Cells[4].Text + "&varphone=" + row.Cells[5].Text, "_blank",
"width=800, height=1000, fullscreen=no");

The problem is after that I click on another web page (aspx) that needs
to use those same session variables.

Since they are session variable is there anyway that the other web page
can access those session variables?

Yes, the other page can use the session variables (a common shared
memory) on the Web server, which can be used between pages.
 
H

Harlan Messinger

JB said:
Hello Community

Using ASP.NET, C# and Sql Server I produce a report by declaring session
variable and passing the variables to a report like so:

Session["ssnum"] = varssnum;
Session["lname"] = varlname;
Session["fname"] = varfname;
Session["dob"] = vardob;
Session["phone"] = varphone;

ResponseHelper.Redirect("lFolder/reports.aspx?varssnum;=" +
row.Cells[1].Text +
"&varlname=" + row.Cells[2].Text + "&varfname=" + row.Cells[3].Text +
"&vardob=" + row.Cells[4].Text + "&varphone=" + row.Cells[5].Text, "_blank",
"width=800, height=1000, fullscreen=no");

The problem is after that I click on another web page (aspx) that needs
to use those same session variables.

Since they are session variable is there anyway that the other web page
can access those session variables?

The whole *purpose* of session variables is to save application data
from one page request to the next--within an ASP.NET session, however.
If you go to a page that isn't in the same application, it won't work.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top