pass data from page to page

Discussion in 'ASP .Net' started by =?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?=, Dec 4, 2006.

  1. Is there a way to pass data from page to page without the use of a Session
    Variable or queryString?
    I need to pass drop down box selections from page to page and have the drop
    downs on the page be the same as they were on the page the user is coming
    from. I'm using a master page and a sitemap file for my menu.

    example:
    If I'm in page 1 and I select
    BMW in dropdown 1 and 535 in drop down 2
    if i select a new page on the menu, the drop downs on that page needs to
    have selected BMW (since that drowndown data is on that page as well.)

    what is the best way to do this?
     
    =?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?=, Dec 4, 2006
    #1
    1. Advertising

  2. You can also set a cookie. Sometimes this works nicely as the session
    management can be a drain on the server whereas the cookie will just be on
    the client. Of course, the user may not have their browser to accept
    cookies, but that would also provide issues for the session as well since
    the id is stored in a cookie unless explicitely using cookieless sessions.

    The cookies may be the easiest since they work well with more than ust
    ASP.Net and they're pretty lightweight as far as server resources.


    --

    Hope this helps,
    Mark Fitzpatrick
    Former Microsoft FrontPage MVP 199?-2006



    "igotyourdotnet" <> wrote in message
    news:...
    > Is there a way to pass data from page to page without the use of a Session
    > Variable or queryString?
    > I need to pass drop down box selections from page to page and have the
    > drop
    > downs on the page be the same as they were on the page the user is coming
    > from. I'm using a master page and a sitemap file for my menu.
    >
    > example:
    > If I'm in page 1 and I select
    > BMW in dropdown 1 and 535 in drop down 2
    > if i select a new page on the menu, the drop downs on that page needs to
    > have selected BMW (since that drowndown data is on that page as well.)
    >
    > what is the best way to do this?
     
    Mark Fitzpatrick, Dec 4, 2006
    #2
    1. Advertising

  3. =?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?=

    LosManos Guest

    hejdig.

    Normal posting?

    You could program with client side controls.
    <form target="otherpage.aspx" method="post">
    <select name="ddlCar"><option....
    </form>
    and on otherpage.aspx.cs
    string carID = Request[ "ddlCar" ];

    Something like that. I don't have the exact attribute and method names in
    my head. Google for ASP solutions.

    HTH

    /OF

    ----8<---

    "igotyourdotnet" <> wrote in message
    news:...
    > Is there a way to pass data from page to page without the use of a Session
    > Variable or queryString?
    > I need to pass drop down box selections from page to page and have the
    > drop
    > downs on the page be the same as they were on the page the user is coming
    > from. I'm using a master page and a sitemap file for my menu.
    >
    > example:
    > If I'm in page 1 and I select
    > BMW in dropdown 1 and 535 in drop down 2
    > if i select a new page on the menu, the drop downs on that page needs to
    > have selected BMW (since that drowndown data is on that page as well.)
    >
    > what is the best way to do this?
     
    LosManos, Dec 4, 2006
    #3
  4. On Mon, 4 Dec 2006 07:40:00 -0800, igotyourdotnet wrote:

    > Is there a way to pass data from page to page without the use of a Session
    > Variable or queryString?
    > I need to pass drop down box selections from page to page and have the drop
    > downs on the page be the same as they were on the page the user is coming
    > from. I'm using a master page and a sitemap file for my menu.
    >
    > example:
    > If I'm in page 1 and I select
    > BMW in dropdown 1 and 535 in drop down 2
    > if i select a new page on the menu, the drop downs on that page needs to
    > have selected BMW (since that drowndown data is on that page as well.)
    >
    > what is the best way to do this?


    You can investigate the features of asp.net 2 that allow pages to post to
    other pages. You can also check out the profile object.

    Though i'm curious -- why don't you want to use Sessions?

    --
    Bits.Bytes
    http://bytes.thinkersroom.com
     
    Rad [Visual C# MVP], Dec 4, 2006
    #4
  5. Hi,

    In following MSDN documentation:

    #How to: Pass Values Between ASP.NET Web Pages
    http://msdn2.microsoft.com/en-us/library/6c3yckfw(vs.80).aspx

    Besides query string and session state, you can use cross-page posting:

    #Cross-Page Posting in ASP.NET Web Pages
    http://msdn2.microsoft.com/en-us/library/ms178139(VS.80).aspx


    or use HttpServerUtility.Transfer():

    #HttpServerUtility.Transfer Method (String) (System.Web)
    http://msdn2.microsoft.com/en-us/library/y4k58xk7(VS.80).aspx
    The Transfer method preserves the QueryString and Form collections.



    Sincerely,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications. If you are using Outlook Express, please make sure you clear the
    check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
    promptly.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Dec 5, 2006
    #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. Replies:
    2
    Views:
    827
  2. Jerry
    Replies:
    20
    Views:
    7,950
    Roedy Green
    Sep 9, 2005
  3. blufox
    Replies:
    2
    Views:
    563
  4. Mr A
    Replies:
    111
    Views:
    2,127
  5. Radde
    Replies:
    38
    Views:
    999
Loading...

Share This Page