473,322 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Passing information between pages

Hi

I have on my page1.aspx the following;

Context.Items("Msg1") = msgstr
Response.Redirect("Page2.aspx")

Page2.aspx has the following;

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
lblMsg.Text = CType(Context.Items("Msg1"), String)
End Sub

The Context.Items("Msg1") does not seem to be getting to page2.aspx however.
What am I missing?

Thanks

Regards
Apr 15 '06 #1
1 1029
"John" <Jo**@nospam.infovis.co.uk> wrote in
news:#7**************@TK2MSFTNGP03.phx.gbl:
Hi

I have on my page1.aspx the following;

Context.Items("Msg1") = msgstr
Response.Redirect("Page2.aspx")

Page2.aspx has the following;

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
lblMsg.Text = CType(Context.Items("Msg1"), String)
End Sub

The Context.Items("Msg1") does not seem to be getting to
page2.aspx however. What am I missing?


John,

Use Server.Transfer instead of Response.Redirect if you want to
transfer the content of Context.Items between pages.

Response.Redirect sends a response to the client browser telling it
to request the given page. Server.Transfer keeps all processing on
the server - it stops the processing of the current page and starts
processing the given page.

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Apr 15 '06 #2

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

Similar topics

5
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...
1
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:...
3
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...
4
by: Grant | last post by:
Im using C# in a web app. Ive got a page with a linkbutton with the following code for the click event: ----------------- Session = "Test"; Server.Transfer("TestPage.aspx"); -----------------...
5
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. ...
4
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...
7
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
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...
6
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...
3
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.