Passing information between pages C# and ASP

M

Marina

You are assigning a value to a session variable - but then trying to get the
value of that variable from the query string? Huh? Those 2 are not related
in any way.

And you can't read a session variable set in ASP.NET in ASP or vice versa.
 
G

Grant

Im using C# in a web app. Ive got a page with a linkbutton with the
following code for the click event:

-----------------
Session["FirstTime"] = "Test";
Server.Transfer("TestPage.aspx");
-----------------

In the testpage Page_Load section I have the following:
------------------
string SessionTest = Request.QueryString["FirstTime"];
------------------

In debug mode the session state holds nothing. Please could someone show me
how to correctly store information in the session state that can be
retrieved from another page.

Greatly appreciated,
Thanks,
Grant
 
G

Grant

Marina - that example came from MSDN, do you know how to do it or not your
response was no help at all. Ive been using Properties and the
Context.Handler to get parameters between pages.

Thanks for your answer Clinton. I posted it here because im on dial up and
web access is dog slow - so not lazy, just trying to keep web frustration
levels to a minimum.

Boyit'scoldinhere!
 
C

clintonG

Excuses. Excuses but good to see you can take a joke.

Now beg, borrow or steal a copy of asp.netPro, October 2005 which I think
should still be on the shelves.
The cover has a "Keep Out Armed Gaurd on Duty."

Steve Orr has written a masterpiece...
"Passing Values - How Do I Pass Values between Pages, Controls and other
Objects?"


<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/






Grant said:
Marina - that example came from MSDN, do you know how to do it or not your
response was no help at all. Ive been using Properties and the
Context.Handler to get parameters between pages.

Thanks for your answer Clinton. I posted it here because im on dial up and
web access is dog slow - so not lazy, just trying to keep web frustration
levels to a minimum.

Boyit'scoldinhere!

Grant said:
Im using C# in a web app. Ive got a page with a linkbutton with the
following code for the click event:

-----------------
Session["FirstTime"] = "Test";
Server.Transfer("TestPage.aspx");
-----------------

In the testpage Page_Load section I have the following:
------------------
string SessionTest = Request.QueryString["FirstTime"];
------------------

In debug mode the session state holds nothing. Please could someone show
me how to correctly store information in the session state that can be
retrieved from another page.

Greatly appreciated,
Thanks,
Grant
 

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

Top