Static classes with static members

Discussion in 'ASP .Net' started by Ben, Jun 1, 2004.

  1. Ben

    Ben Guest

    Do static classes with static members persist between page hits in asp.net?
    I'm seeing some very weird behavior and that might explain it. I'm not
    really sure the best way to test it, so I thought I'd ask :)

    TIA,
    Ben
     
    Ben, Jun 1, 2004
    #1
    1. Advertising

  2. Ben

    John Oakes Guest

    They have application scope, so yes, they do.

    -John Oakes

    "Ben" <> wrote in message
    news:ZK4vc.2567$...
    > Do static classes with static members persist between page hits in

    asp.net?
    > I'm seeing some very weird behavior and that might explain it. I'm not
    > really sure the best way to test it, so I thought I'd ask :)
    >
    > TIA,
    > Ben
    >
    >
    >
     
    John Oakes, Jun 1, 2004
    #2
    1. Advertising

  3. "Ben" <> wrote in message
    news:ZK4vc.2567$...
    > Do static classes with static members persist between page hits in

    asp.net?
    > I'm seeing some very weird behavior and that might explain it. I'm not
    > really sure the best way to test it, so I thought I'd ask :)


    They should exist between page hits, but not over AppDomain restarts. For
    instance, when you change the web.config, the AppDomain will be destroyed,
    including your statics.

    --
    John Saunders
    johnwsaundersiii at hotmail
     
    John Saunders, Jun 1, 2004
    #3
  4. Ben

    Ben Guest

    Ouch, I thought they were scoped out at the page level...

    Thanks!!!! :)
    "John Oakes" <> wrote in message
    news:%...
    > They have application scope, so yes, they do.
    >
    > -John Oakes
    >
    > "Ben" <> wrote in message
    > news:ZK4vc.2567$...
    > > Do static classes with static members persist between page hits in

    > asp.net?
    > > I'm seeing some very weird behavior and that might explain it. I'm not
    > > really sure the best way to test it, so I thought I'd ask :)
    > >
    > > TIA,
    > > Ben
    > >
    > >
    > >

    >
    >
     
    Ben, Jun 1, 2004
    #4
    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. maxw_cc
    Replies:
    6
    Views:
    532
    James Brady
    Dec 4, 2003
  2. JFCM
    Replies:
    4
    Views:
    5,746
  3. Alibek
    Replies:
    3
    Views:
    556
    Gianni Mariani
    Dec 17, 2003
  4. Daz
    Replies:
    5
    Views:
    587
  5. Rit
    Replies:
    23
    Views:
    953
    Mike Schilling
    Jan 3, 2010
Loading...

Share This Page