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

Which option is best

I have 2 asp pages, Page1.asp and Page2.asp. Page2 is a "printable"
version of Page1 and it contains the same information as Page1.

When Page1 is loaded in the browser it connects to a database and
retrieves some information which is used to do some calculations and
to display some data on this page. At the bottom of the page is a
'Print' button. When the user clicks this button it opens Page2 in a
new window and displays the same data in a format that can be printed.

Which is the best way to get the information from Page1 to Page2:

1. Using hidden fields on Page1.asp
2. Using session variables
3. Connecting to the database on Page2 and retrieving the information
again.

I'm considering option 1, creating form with hidden fields on Page1
that will contain the values that are required on Page2 and posting
that form to Page2.

Page2 will contian code such as:

dim Temp1, Temp2
Temp1 = Request.Form("Field1Name")
Temp2 = Request.Form("Field2Name")

for each of the fields on Page1. The data will be displayed on this
print-friendly page using code similar to:

Field One: <%=Temp1%>
Field Two: <%=Temp2%>

Is this the right approach, or would I be better off using one of the
other approaches (session varibles or retrieving the data from the
datbase again)?
Jul 19 '05 #1
4 1571
> I have 2 asp pages, Page1.asp and Page2.asp. Page2 is a "printable"
version of Page1 and it contains the same information as Page1.


Why do you have separate pages for this? Did you know that you can use
style sheets to hide certain elements, change sizes, colors, etc. so that
any page can become a printer friendly page without taking away from the
on-screen prettiness? (http://www.w3.org/TR/REC-CSS2/media.html)

I'm working on a new version of aspfaq.com and you'll probably be amazed at
the contrast between on-screen and printed versions of the same article.

This dual-page maintenance thing is for the birds... it reminds me of the
days when we used to make a Netscape page, and an IE page...

A
Jul 19 '05 #2
I concur. use the css solution. No round trip needed.

-dlbjr

Discerning resolutions for the alms
Jul 19 '05 #3
I'd vote for option 3:
<<
3. Connecting to the database on Page2 and retrieving the information
again.


Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4
Bullschmidt <pa**@bullschmidt.com-nospam> wrote in message news:<#H**************@TK2MSFTNGP10.phx.gbl>...
I'd vote for option 3:

3. Connecting to the database on Page2 and retrieving the information
again.

Isn't option 3 more "resource intensive" and "slower" since it does
involve another trip to the server to connect to the database?

The CSS approach that Aaron suggested does sound like a really good
approach that I hadn't thought of.
Jul 19 '05 #5

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

Similar topics

3
by: Unforgiven | last post by:
I have the following situation: Given this class: template<typename T> class Expression { /* omitted */ }; This is the base class for a BooleanExpression and an ArithmeticExpression.
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: Lerp | last post by:
Hi all, With regards to calling data from a database and filling in an editing form based on some query, which is the best (least intensive on processor) method for assigning the returned...
53
by: Jon S via DotNetMonster.com | last post by:
Hi all, I'm planning on developing an ASP.NET web site. I know both VB.NET and C# but am unsure on which would be more useful to develop an ASP.NET site with? Also I maybe looking to become a...
16
by: tinman | last post by:
Hi... I have the following two code excerpts. It basically reads data froma dataReader and adds it to a collection.... Excerpt A: ******* With ProjectData
5
nehashri
by: nehashri | last post by:
hi can ne1 plz guide me as to which interface is best for posgresql. i have started using posgrsql recently. i am making a biological database which has a frontend allowing the user to select...
1
by: thermate | last post by:
http://www.latimes.com/news/nationworld/nation/la-na-libby26jan26,1,2730931.story?coll=la-headlines-nation Aide testifies Cheney helped effort to discredit Wilson By Richard B. Schmitt, Times...
2
by: rn5a | last post by:
A Form has a select list which is populated from a MS-Access database table. The DB table from where the select list is populated has 2 columns - CountryID & CountryName. When the Form is posted,...
8
by: Rory Becker | last post by:
A wise man once said: "Never put off until runtime what you can fix at compile time." Actually I think he said it about 10 minutes before I started this post. I am a firm believer, like the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.