Which option is best

Discussion in 'ASP General' started by Luis, Nov 17, 2003.

  1. Luis

    Luis Guest

    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)?
     
    Luis, Nov 17, 2003
    #1
    1. Advertising

  2. > 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
     
    Aaron Bertrand - MVP, Nov 17, 2003
    #2
    1. Advertising

  3. Luis

    dlbjr Guest

    I concur. use the css solution. No round trip needed.

    -dlbjr

    Discerning resolutions for the alms
     
    dlbjr, Nov 17, 2003
    #3
  4. Luis

    Bullschmidt Guest

    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!
     
    Bullschmidt, Nov 18, 2003
    #4
  5. Luis

    Luis Guest

    Bullschmidt <-nospam> wrote in message news:<#>...

    > 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.
     
    Luis, Nov 19, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julien ROUZIERES

    g++ -pg option and -shared option

    Julien ROUZIERES, Dec 21, 2004, in forum: C++
    Replies:
    1
    Views:
    725
    GianGuz
    Dec 21, 2004
  2. Cas
    Replies:
    5
    Views:
    793
    Kevin Jones
    Aug 28, 2006
  3. Kevin Blount

    page.aspx?option - how to detect "option"

    Kevin Blount, Nov 28, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    607
    =?Utf-8?B?RWVyYWo=?=
    Nov 28, 2006
  4. John

    Regex for <option> ... </option>

    John, Jan 23, 2009, in forum: Perl Misc
    Replies:
    10
    Views:
    240
    Eric Pozharski
    Jan 29, 2009
  5. Mark Kolber
    Replies:
    4
    Views:
    348
Loading...

Share This Page