Application state

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ninja

    #1

    Application state

    Is everything stored in Application or Session state boxed? For example:
    Application["MyVar"] = 10;

    Is there boxing involved?

    Thanks.
    Just learning ASP.NET


  • Kevin Spencer

    #2
    Re: Application state

    Boxing doesn't come into play until you treat a value type like a reference
    type. For example, the integer 10 is a value type. But if you execute any of
    the integer methods on the number, it is boxed as an object and then the
    method is executed. Therefore, what memory space (such as Application State)
    you store a variable in has no effect upon what is stored there.
    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

    Big things are made up of
    lots of little things.

    "Ninja" <ninja@kungfuch aos.com> wrote in message
    news:uDFqSMBUDH A.2308@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Is everything stored in Application or Session state boxed? For example:
    > Application["MyVar"] = 10;
    >
    > Is there boxing involved?
    >
    > Thanks.
    > Just learning ASP.NET
    >
    >[/color]


    Comment

    Working...