473,513 Members | 4,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing Data to Page

I'm new to ASP.NET and am trying to create some of my first Web pages.

I'd like the user to enter about a dozen fields, and then have another page
create a table based on the information entered.

What is the best way to forward the data from the first page to the second?
Is the Session object the best way to handle this data?

Also, I will of course need a way for the second page to intelligently
handle missing data, or when the user goes directly to the second page,
bypassing the first.

Thanks.

Jonathan
Sep 16 '06 #1
2 1175
Try this instead:

1. Create a new page
2. Add two panels, the first called pnlForm, the other called pnlComplete
(use whatever names you like)
3. Set both panels to Visible=false to start
4. In Page_Load set pnlForm to visible=true

VB.NET
If Not (Page.IsPostback) Then
pnlForm.Visible = true
pnlComplete.Visible = false
End If

5. In the click event for the form, do this

pnlForm.Visible = false
pnlCOmplete.Visible = true'

Then, write code to bind the data based on the form submit. If you do it
this way, you have the code in one place, which is much easier to use.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Oj**************@TK2MSFTNGP05.phx.gbl...
I'm new to ASP.NET and am trying to create some of my first Web pages.

I'd like the user to enter about a dozen fields, and then have another
page create a table based on the information entered.

What is the best way to forward the data from the first page to the
second? Is the Session object the best way to handle this data?

Also, I will of course need a way for the second page to intelligently
handle missing data, or when the user goes directly to the second page,
bypassing the first.

Thanks.

Jonathan


Sep 16 '06 #2
For the stuff I'm working on, the user has the option of entering
information on up to five items. I think the technique you described might
work nicely for display fields for one item at a time.

I think for the results page though, I'd still like a separate page.

Does the Session object make sense in this case?

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:e5**************@TK2MSFTNGP04.phx.gbl...
Try this instead:

1. Create a new page
2. Add two panels, the first called pnlForm, the other called pnlComplete
(use whatever names you like)
3. Set both panels to Visible=false to start
4. In Page_Load set pnlForm to visible=true

VB.NET
If Not (Page.IsPostback) Then
pnlForm.Visible = true
pnlComplete.Visible = false
End If

5. In the click event for the form, do this

pnlForm.Visible = false
pnlCOmplete.Visible = true'

Then, write code to bind the data based on the form submit. If you do it
this way, you have the code in one place, which is much easier to use.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Oj**************@TK2MSFTNGP05.phx.gbl...
>I'm new to ASP.NET and am trying to create some of my first Web pages.

I'd like the user to enter about a dozen fields, and then have another
page create a table based on the information entered.

What is the best way to forward the data from the first page to the
second? Is the Session object the best way to handle this data?

Also, I will of course need a way for the second page to intelligently
handle missing data, or when the user goes directly to the second page,
bypassing the first.

Thanks.

Jonathan



Sep 17 '06 #3

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

Similar topics

5
5925
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 contains: <?php $_SESSION = ""; $_SESSION = "";
1
7770
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: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION =...
12
6510
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html ...
1
4581
by: Kevin Lyons | last post by:
Hello, I am trying to get all of my form elements passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html to the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing name, email, countries, cities, products, courses, etc. The others display as they should...
5
6674
by: Jack | last post by:
Hi, I need to pass multple variables in a link in order to go to a asp page with the two varables. The following are the values of the variables using response.write: <%'Response.Write Mypage & "<br>"%> Exp <%'Response.Write GrantID & "<br>"%>
27
6165
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is done? regards, Oscar
3
4739
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing around chunks of data in DataTables/DataSets, simply because that was the format that they were in when the data was taken from the database. Now,...
5
2110
by: Rod | last post by:
I've written 2 ASP.NET applications (I've worked on one with a team and another by myself). In my ASP.NET pages, when saving data to a backend database I've done it by using the click event of a button and just using the data during postback. Now, however, I've got a WebForm that I'll be working on, and it is going to collect more data than...
7
1869
by: Smokey Grindle | last post by:
For a website that has users logged into it using sessions, its it best to pass data between pages in session variables or through query strings?
4
4150
by: moondaddy | last post by:
I have a htm page where I need to pass some data to an aspx page as a means of sending data to the database. I don't need to see the aspx page so I was going to put it in a hidden iframe. This works real good. Since I don't need the aspx page to do any postback, is there a way to pass a parameter to it with out it finishing the round trip...
0
7270
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...
1
7125
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...
0
7543
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...
0
5703
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...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
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...
0
1612
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
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.