Variable scope

Discussion in 'ASP .Net' started by Vincent V, Jul 5, 2003.

  1. Vincent V

    Vincent V Guest

    What type of variable can you use that lasts between page refreshes is it
    possible or do i have to use session or a hidden field

    thanks
     
    Vincent V, Jul 5, 2003
    #1
    1. Advertising

  2. Vincent V

    dave wanta Guest

    you could use a public static property on a class,
    or
    Application[]
    or
    Cache[]
    or
    Session[]

    hth,
    Dave
    www.aspNetEmail.com



    "Vincent V" <> wrote in message
    news:...
    > What type of variable can you use that lasts between page refreshes is it
    > possible or do i have to use session or a hidden field
    >
    > thanks
    >
    >
     
    dave wanta, Jul 5, 2003
    #2
    1. Advertising

  3. You can also try Viewstate["yourkey"] = "value" if you have viewstate
    enabled.

    George Zacharias.

    "Vincent V" <> wrote in message
    news:...
    > What type of variable can you use that lasts between page refreshes is it
    > possible or do i have to use session or a hidden field
    >
    > thanks
    >
    >
     
    George Zacharias, Jul 5, 2003
    #3
  4. Normally you'd use Session state, or Viewstate, or the Application object,
    or the Cache object, or Cookies. A hidden field could also work. They all
    have their trade offs.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "Vincent V" <> wrote in message
    news:...
    > What type of variable can you use that lasts between page refreshes is it
    > possible or do i have to use session or a hidden field
    >
    > thanks
    >
    >
     
    Steve C. Orr, MCSD, Jul 6, 2003
    #4
  5. Vincent V

    David Waz... Guest

    Vincent,

    it's called "buy a basic book on asp/aspx"
    or read the included on-line documentation. Some questions are just so
    basic that IMHO they don't belong here.


    "Vincent V" <> wrote in message
    news:...
    > What type of variable can you use that lasts between page refreshes is it
    > possible or do i have to use session or a hidden field
    >
    > thanks
    >
    >
     
    David Waz..., Jul 6, 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. Paul Opal
    Replies:
    12
    Views:
    1,005
    Paul Opal
    Oct 11, 2004
  2. ann
    Replies:
    13
    Views:
    696
    Patricia Shanahan
    Sep 13, 2005
  3. Steven T. Hatton
    Replies:
    9
    Views:
    520
  4. David Filmer
    Replies:
    19
    Views:
    280
    Kevin Collins
    May 21, 2004
  5. Andrew Falanga
    Replies:
    2
    Views:
    217
    Andrew Falanga
    Nov 22, 2008
Loading...

Share This Page