473,396 Members | 1,933 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,396 software developers and data experts.

Posting Value to another form

Lets say I have web1.aspx which the user inputs data into txtData (text
box). When the user clicks the button ADD the browser takes the user to
web2.aspx. On web2.aspx I need to post the data entered from the first
page.

Is it best to use a querystring, session variable or is there a better
alternative. Currently I use session variables for a lot of my work but
want to get away from that since there are better alternatives.

Thanks
Nov 18 '05 #1
3 1276
Hi Brian,

Here's one way:

http://authors.aspalliance.com/kenc/passval.aspx

"Brian Shannon" <bs******@lbrspec.com> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Lets say I have web1.aspx which the user inputs data into txtData (text
box). When the user clicks the button ADD the browser takes the user to
web2.aspx. On web2.aspx I need to post the data entered from the first
page.

Is it best to use a querystring, session variable or is there a better
alternative. Currently I use session variables for a lot of my work but
want to get away from that since there are better alternatives.

Thanks


Nov 18 '05 #2
QS will work fine if it's not a ton. Just have the button grab the value,
write it and then redirect.
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Brian Shannon" <bs******@lbrspec.com> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Lets say I have web1.aspx which the user inputs data into txtData (text
box). When the user clicks the button ADD the browser takes the user to
web2.aspx. On web2.aspx I need to post the data entered from the first
page.

Is it best to use a querystring, session variable or is there a better
alternative. Currently I use session variables for a lot of my work but
want to get away from that since there are better alternatives.

Thanks

Nov 18 '05 #3
Brian,

You could use server.transfer (That's my preferred method). Via
server.transfer there are two ways to send one form's data to another form.

The first is to use: Server.Transfer("webform2.aspx", True) where "True"
indicates that the previous forms querystring and post data should be
persisted and can then be accessed the same way as on webform1.aspx.

The second is to set any data you wish to transfer in the page's context
object which works the same way as many dictionary based objects:
Context.Items.Add("MyData", "This is a string")
Server.Transfer("webform2.aspx") and then on webform2.aspx retrieve the
data: Dim MyString As String = Context.Items.Item("MyData").ToString

Both methods may also be used together.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Brian Shannon" <bs******@lbrspec.com> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Lets say I have web1.aspx which the user inputs data into txtData (text
box). When the user clicks the button ADD the browser takes the user to
web2.aspx. On web2.aspx I need to post the data entered from the first
page.

Is it best to use a querystring, session variable or is there a better
alternative. Currently I use session variables for a lot of my work but
want to get away from that since there are better alternatives.

Thanks

Nov 18 '05 #4

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

Similar topics

3
by: Boefje | last post by:
The variable contains: delete from divisies where divisieid='1c' After posting it contains: delete from divisies where divisieid= So the part '1c' is magically lost! How is that possible? This...
1
by: Gregor Rot | last post by:
Hi, i have a form that points to a document on my local site, like: <form action="test.php" method="post"> <input type=hidden name=value1 value="something"> <input type=submit value=submit>...
3
by: Itai | last post by:
I have an aspx file named index.aspx which contains two ‘form' sections, one that has the runat=server attribute (e.g From1) and one which is a regular HTML form (e.g SignInForm). I am trying...
4
by: Newbie | last post by:
Hi, I need help in posting asp .net application web form to another asp based web app. I have seen many examples using HttpWebRequest class but the problem is I do not want the request back...
9
by: Denise | last post by:
I have posted a similar message in 2 other forums but got no response. I have spent more hours than I can count researching this. Can anyone provide some insight...? Our ASP.Net application...
2
by: Peter2 | last post by:
Hi, I have a problem posting non-ASCII characters in FORM fields between classic ASP and ASP.NET. I use a fully patched Windows 2000 Advanced Server with .net 2.0 and visual Studio 2005 installed,...
2
by: Norman Peelman | last post by:
From: "Norman Peelman" <npeelman@cfl.rr.com> Subject: Re: posting form data to two php scripts at once Date: Sunday, December 17, 2006 12:06 AM <one.1more@gmail.comwrote in message...
1
by: hotrod57 | last post by:
I am trying to append the results from a form to a text file. My code is supposed to print out the results on one page, and append the results to another page each time data is entered on the form...
4
by: mlevit | last post by:
Hey all, This is really simple but I just can't get it work. I have a drop down menu, you select your filter which will repost to the same page and grab that filter which will be used for an SQL...
1
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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...

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.