473,666 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I keep form variables?

Hi

I have two forms on one ASPX order page. There are two submit buttons:

1) "Calculate"
2) "Order"

The first form at the top of the page has the Product Name and Quantity as
form fields. The calculate button works out the total order cost and puts it
into a form field when the button is clicked and the page re-loaded (POST
action)

The second form has the customer order details; name, address, telephone
etc.

I have a MSAccess database to store all data, including the price and
quantity. However, whilst the database has the name, address, telephone etc,
the price and quantity are always blank. I am using the Request("Quanti ty")
syntax for ASP. I have tried to store the value with Session("Quanti ty") but
that still comes up blank. I don't want to use Cookies.

Any suggestions?

TIA

Nov 19 '05 #1
2 1263
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items(" myParameter") = x
Server.Transfer ("WebForm2.aspx ")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.I tems("myParamet er"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

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

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Mark 123" <no**@none.co m> wrote in message
news:lG******** ************@ne ws.xtra.co.nz.. .
Hi

I have two forms on one ASPX order page. There are two submit buttons:

1) "Calculate"
2) "Order"

The first form at the top of the page has the Product Name and Quantity as
form fields. The calculate button works out the total order cost and puts
it
into a form field when the button is clicked and the page re-loaded (POST
action)

The second form has the customer order details; name, address, telephone
etc.

I have a MSAccess database to store all data, including the price and
quantity. However, whilst the database has the name, address, telephone
etc,
the price and quantity are always blank. I am using the
Request("Quanti ty")
syntax for ASP. I have tried to store the value with Session("Quanti ty")
but
that still comes up blank. I don't want to use Cookies.

Any suggestions?

TIA


Nov 19 '05 #2
Thanks. I wonder if that will work where instead of progressing on to a
second webpage, the 'next' webpage is just a refresh caused by clicking the
'Calculate' button which does a form POST.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items(" myParameter") = x
Server.Transfer ("WebForm2.aspx ")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.I tems("myParamet er"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc. You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx
http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Mark 123" <no**@none.co m> wrote in message
news:lG******** ************@ne ws.xtra.co.nz.. .
Hi

I have two forms on one ASPX order page. There are two submit buttons:

1) "Calculate"
2) "Order"

The first form at the top of the page has the Product Name and Quantity as form fields. The calculate button works out the total order cost and puts it
into a form field when the button is clicked and the page re-loaded (POST action)

The second form has the customer order details; name, address, telephone
etc.

I have a MSAccess database to store all data, including the price and
quantity. However, whilst the database has the name, address, telephone
etc,
the price and quantity are always blank. I am using the
Request("Quanti ty")
syntax for ASP. I have tried to store the value with Session("Quanti ty")
but
that still comes up blank. I don't want to use Cookies.

Any suggestions?

TIA



Nov 19 '05 #3

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

Similar topics

3
6117
by: Jason | last post by:
hello, i am new to PHP, so go easy. I am using the examples in the book: PHP: Your Visual Blueprint For Creating Open Source, Server Side Content In the section where they talk about getting values from a form submission, the book says:
5
3528
by: Hung Huynh | last post by:
Hello, I have 2 separate web sites on 2 different boxes www.xyz.com on box 1 www2.xyz.com on box 2 Users log into box 1 via regular ASP/Database authentication, and I keep a session variable to mark authenticated users.
1
5312
by: john woo | last post by:
Hi I'm not good at JS, but want to get more about it. I want to use a JSP (the java code just used to get date, the rest are html and javascript), to display a table. the requirement is the all rows in even number in light-blue, rows in odd number in light gray, when a mouse clicks on a row, this row gets highlighted and in yellow, and it keeps highlighted
1
1320
by: Stephen | last post by:
hi all, I am making form in access and I want to have a checkbox that when clicked will allow the user to not have to input all of the data again since some of the entered data will be the same but will clear out the other fields. So I want to "selectively keep" some of the data in the form. It will save several hours of work if I can do this. :-) Thanks, Stephen
3
6345
by: Paul | last post by:
Hello, First I want to refer to the problem "WebRequest : execute a button" of a few days ago. The way I solved it, I loose my session, and as a consequence my session variables. I don't want to keep those variables, as an alternative, as ViewState variables because I don't want to transfer to many hidden fields. This is the code I use :
3
2903
by: Alan Wang | last post by:
Hi there, Once my application gets complicated and complicated. I found it's really hard to keep track of Session value I am using in my asp.net application. I am just wondering if anyone have any experience on how to keep track of session value. Any help it's appreciated. Thanks Alan
10
7235
by: EOZyo | last post by:
Hi, i'm trying to set pagination for a search i run on my website, i'll try to explain the easiest i can: When i click the search button on search.php, data is received and stored in variables within results.php, MySQL structure seems to work as expected, although i get some problems: As soon as i click on the "Page 2" Link, i get nothing, neither results nor page numbers.
1
1570
by: david | last post by:
My question is how to keep the values of JavaScript variable unchanged when the page is posted back to the server? Problem: The JavaScript is used in HTML for computing in aspx web page (form) design. When the page is posted back to the server, the values of JavaScript variables are initialized again. So the computing result would be wrong after poatback. Thank you for any help and suggestion.
5
7170
by: ManningFan | last post by:
This is something I haven't come across yet, but it's something I need to do. Don't ask why, it's just got to get done. I need to keep a table of all changes to a specific field in another table. I've never dealt with anything like this. How would I get the value that's in a field and then the value that it was changed to, and pass both of them to a table? Well, I know how to pass them to the table, but I don't know how I would store...
8
5267
by: chromis | last post by:
Hi, I'm writing a contacts section for a cms on a website, I've decided to write the section in OO code. So far I have my Contacts object and a page structure I would use for a procedural site. /com/Contacts.cfc <cfcomponent displayname="Contact" output="false" hint="Contact component"> <!--- properties: used for self-documentation ---> <cfproperty name="dsn" displayname="dsn" hint="Contact id (UUID)" type="string" required="false"...
0
8448
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
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8783
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...
1
8552
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
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
7387
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
5666
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();...
1
2773
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 we have to send another system
2
2011
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.