473,770 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1303
Hi Brian,

Here's one way:

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

"Brian Shannon" <bs******@lbrsp ec.com> wrote in message
news:OO******** ******@TK2MSFTN GP09.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******@lbrsp ec.com> wrote in message
news:OO******** ******@TK2MSFTN GP09.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.A dd("MyData", "This is a string")
Server.Transfer ("webform2.aspx ") and then on webform2.aspx retrieve the
data: Dim MyString As String = Context.Items.I tem("MyData").T oString

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******@lbrsp ec.com> wrote in message
news:OO******** ******@TK2MSFTN GP09.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
2896
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 is more or less the code in my form: $sqldel = "delete from divisies where divisieid='1c' "; echo"<form action=".$_SERVER." method='post' >\n"; echo"<input class='serred' type=submit value='Verwijderen'
1
1349
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> </form> now, i would like to post the form data to the test.php file, from another php file (let's say test2.php)! how to do that?
3
2576
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 to copy values from two INPUT controls that are located within the Form1 section to hidden INPUT controls located in the SignInForm and post the SignInForm form hidden controls values to a different page (e.g login.aspx) Problem is that after...
4
1625
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 but want to post the data to another form so that at the asp page level we can use request.form values. Any leads would definately be appreciated.
9
1853
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 needs to transparently log a user on to a separate secure web site (PHP - not controlled by us). We want to save the user the step of typing in his username and password and having to press submit. I could accomplish this by using the <form...
2
7053
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, IIS, IE6 etc ... When an *.ASPX page receives the post, it drops non-ASCII characters, for example it drops character é from word Montréal. Specifying explicit encoding on ASP/ASPX page doesn't help. The encoding works without doing anything...
2
2873
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 news:1166317725.715320.309280@80g2000cwy.googlegroups.com... Yes, you just have to call the second script from the first. You could try:
1
1951
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 and the submit button is hit. Unfortunately, it is only printing out the message acknowledging the submit button--no data on either form. Here is the code below, please help if you can. PHP code that reads the form submission: <?php function...
4
1650
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 query. $filter = $_POST; if ($filter == "" || $filter == "All") { $query = "SELECT * FROM orders WHERE orderStatus = 'New'"; }
1
7294
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 and Brand I need to make some changes on a a number of brands in a Category
0
9617
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
10257
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9904
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
8931
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...
0
6710
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
5354
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
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.