Results 1 to 9 of 9

Thread: Passing Data Question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217

    Passing Data Question

    From my main aspx page, I'm navigating to a seperate aspx page. I need to pass a customer
    id to the page, however, I don't wanna use session variables or a query string. Is there
    any other way around this. Can I set properties on the code-behind page of the destination
    page?

    Thanks

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Why don't you want to use a session variable?

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    What about cookies??

  4. #4
    Member Ooogaleee's Avatar
    Join Date
    Nov 2002
    Location
    Jacksonville, FL
    Posts
    52

    session variables

    I am interested in using session variables to pass a dataset from one page to another as well as using a session variable to send a single parameter from one page to the next. Can anyone fill me in on the proper way (syntax) to declare these session variables? And do they have to be declared in the page_load handler, or can they be dim'd anywhere?

    Thanks...Ooogs

  5. #5
    Fanatic Member Redth's Avatar
    Join Date
    May 2001
    Location
    Ontario, Canada
    Posts
    551
    now, call me crazy, but in what case would you need to store a dataset in a session variable?

    i'd like to see an example where this would pertain... perhaps a shopping cart i guess... it just seems like there would be better less resource intensive ways of storing data than a dataset in a session variable...

    i could be wrong.. i wouldn't mind hearing a good explanation of all this..

  6. #6
    Member Ooogaleee's Avatar
    Join Date
    Nov 2002
    Location
    Jacksonville, FL
    Posts
    52

    my bad

    I guess I did pose that question incorrectly now that I look at it. Sorry about that.

    I just want to pass a single variable from page to page to use it in determining the next's page's dataset. What would be the syntax to declare just a session variable that could hold a string value?

  7. #7
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    syntax:

    VB Code:
    1. dim var as string
    2.  
    3. Session("Name") = var
    ~Ryan





    Have I helped you? Please Rate my posts.

  8. #8
    Member Ooogaleee's Avatar
    Join Date
    Nov 2002
    Location
    Jacksonville, FL
    Posts
    52

    session variables

    Thanks Ryan. One more question...

    Is it important where the session variable is declared? Should it be done in the form_load handler for the start page or can it be done anywhere before I use it for the first time?

    Thanks...Troy

  9. #9
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    I believe you can declare a Session anywhere you want before you use it. There may be instances where you can't, but I have yet to see any of them.
    ~Ryan





    Have I helped you? Please Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width