PC Review


Reply
Thread Tools Rating: Thread Rating: 3 votes, 1.00 average.

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

 
 
JB
Guest
Posts: n/a
 
      14th Jun 2010
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

--
JB
 
Reply With Quote
 
 
 
 
Mr. Arnold
Guest
Posts: n/a
 
      15th Jun 2010
JB wrote:
> 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.
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      15th Jun 2010
JB wrote:
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
aspx to return a 404 with a friendly page inc/Session? Dunc Microsoft ASP .NET 2 18th Jul 2008 04:14 PM
How to Share Session State between .asp and .aspx page ? =?Utf-8?B?U2FjaGluIFNha2k=?= Microsoft ASP .NET 5 23rd May 2007 09:00 AM
I.E 6: ASPX page on SSL session treated like a file. =?Utf-8?B?amJlcmxpbg==?= Windows XP Internet Explorer 0 15th Feb 2006 06:16 PM
Accessing Session variables defined in ASP page in the ASPX page =?Utf-8?B?U2FjaGluIFZhaXNobmF2?= Microsoft ASP .NET 6 17th Aug 2005 08:14 PM
Access ASP session from ASPX js Microsoft ASP .NET 2 10th Jun 2005 09:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:55 PM.