473,387 Members | 3,781 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,387 software developers and data experts.

Passing values between pages?

I've got an asp.net application with a page that collects user info via forms
and I'd like to have those values then passed to a 2nd page for a
continuation which makes use of the entered values from the previous page.
One way that I could think of would be to have the submit button's event
handler call response.redirect with a querystring attached on based on values
that I could attach on.

First question: Could I do the same thing but add the values to the post
variables (the Reqeust.form collection rather than the request.querystring
collection)? Without asp.net, I could very easiiy have the form submitted to
a new page with the client side form "action" attribute, but to be honest,
with ASP.NET, I'm not sure if/how that method would be used. Seems like a lot
of the form stuff is now handled behind the scenes and to access their
contents you just use textboxname.value for example to extract the entered
info. Can one still use the previous method where form elements are simply
submitted and then are retried via request.form or request.querystring? Can
you mix this style in a form runat=sever form? Or does this need to be in a
separate form without Runat=server ?

In any case, would this be the best method for getting the value from one
page to another? Also, what about the circumstance where the entered value is
to be masseged by this page a bit and then sent to the next page, so most
likely a direct trip from client to new page is not possible? Could one take
advantage of the fact that the two pags are in the same application? From
what I've read, it might make sense to use the current context's items
collection. Is this true? If so, is this the only option?

Thanks for any help...

-Ben
Jul 21 '05 #1
3 1489
Ben,

The most simple is to use the page.session.items

session.item("Ben")="Had a question"

I hope this helps,

Cor
Jul 21 '05 #2
Hi Cor,

Thanks for your response. Do you have any idea on if this is preferable to
the current context's items collection or know if there are any more
efficient ways of doing this? Or do you have any idea about my other general
question regarding mixing modes of passing form values to pages? Thanks
again...

-Ben

"Cor Ligthert" wrote:
Ben,

The most simple is to use the page.session.items

session.item("Ben")="Had a question"

I hope this helps,

Cor

Jul 21 '05 #3
Ben,

Although not needed can you forget with ASPNET the post and the get.

By instance a textbox returns the value that is typed in to the server when
there is a Ispostback.

You can that get it easy in your program with.

myexpectedvalue = mytextbox.text

I hope that this was your question,

Cor
Jul 21 '05 #4

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:...
5
by: Raju V.K | last post by:
I am developing a web site which requires a set og unique values be transferred between pages and server many times. There fore i decided to put the values in an array so that only one reference to...
1
by: Matt M | last post by:
Ok. So I'm passing values between web pages, as per microsoft's framework development guide (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht...
4
by: rick | last post by:
Does anyone having a working example of passing values between web forms pages? I tried the example in the ms- help but I can't get by the following: To read property values from the source...
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...
2
by: VS_NET_DEV | last post by:
Hi All, There two ways of passing values between pages - 1) Context.Items.Add 2) Context.Handler (cast the page1 class etc) I know for sure #2 does not store the values between requests. How...
1
by: olduncleamos | last post by:
Hello all. With a background in ASP, I am finding the work required for passing values between pages mystifying. For various obvious reasons, I have eliminated using cookies and session to store...
1
by: Steve | last post by:
After a few hours of trial and error I have reached the following conclusions, can you please tell me if I am right: I have 2 aspx pages both with the same master page and I wish to pass values...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.