473,797 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing information between pages C# and ASP

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.QuerySt ring["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
Nov 17 '05 #1
4 1405
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.

"Grant" <gp*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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.QuerySt ring["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

Nov 17 '05 #2
<snip />

// Source Page
Session["IMLazy"] = "Too Lazy To Search & Lookup Simple Stuff";

// Target Page
string imLazy;
imLazy = Session["IMLazy"].ToString();
Response.Write( imLazy);

// Returns
Too Lazy To Search & Lookup Simple Stuff

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee. com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
Nov 17 '05 #3
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'scoldinhe re!

"Grant" <gp*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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.QuerySt ring["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

Nov 17 '05 #4
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" <gp*****@hotmai l.com> wrote in message
news:uB******** ******@TK2MSFTN GP12.phx.gbl...
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'scoldinhe re!

"Grant" <gp*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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.QuerySt ring["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


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5945
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page contains: <?php $_SESSION = ""; $_SESSION = "";
1
7790
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION = ""; echo "<form method='POST' action='login.php'>
3
4759
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing around chunks of data in DataTables/DataSets, simply because that was the format that they were in when the data was taken from the database. Now, I know this maybe a pretty silly question with a standard "it depends" answer, but I'm going to...
5
1850
by: francois | last post by:
I would like to pass information between ASPX pages. For now, my navigation are hardcoded links. In some case I do a Response.Redirect("pages.aspx") Now I wonder is this is a good way to do. For exemple when I log out of my website, i go back to the logon page but I would like to write on the logon page something like "you succesfully logged out".
4
2357
by: Gibs | last post by:
Hi I have two aspx pages in a frame and in the top page i am creating the controls dynamically and putting in a place holder. I have a hyperlink in this page to populate the data in the bottom aspx page. When the user clicks this hyperlink i need to populate the bottom aspx pagebased on the user imputs. So i need to pass the values from the top aspx page to bottom aspx page. how can i achieve this. Please give some ideas...
7
1884
by: Smokey Grindle | last post by:
For a website that has users logged into it using sessions, its it best to pass data between pages in session variables or through query strings?
14
1645
by: BrendanMcPherson | last post by:
Hello, Im try to do some tricks to help make a "Search Many Sites from One Location". http://www.act.org.au/b_nexus.htm What I have decided to do is this: 1. You can choose which site you wish to visit from the first page, after pressing go it takes you to a frame page.
6
2393
by: DLP35 | last post by:
I'm sure this should be simple enough but I'm really struggling to get my mind around this. I don't have access to a server but am developing a site and I need to pass information from input boxes on one form to a paragraph of text on another. The simplest example I could think of would be a first page with input boxes for Title and Surname: <head> <title>Test</title> <table>
3
2287
by: dbuchanan | last post by:
newbie question What are the various ways that data can be passed between pages. For example; How is data about the logged in user passed to subsequent pages Thank you, Doug
0
9685
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10023
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6803
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3750
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2934
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.