473,480 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1492
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
5920
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
7762
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
7596
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
3019
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
3130
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
2336
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
1992
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
2688
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
2329
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
2272
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
7055
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,...
1
6758
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7010
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...
0
4499
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...
0
3011
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...
0
3003
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
203
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...

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.