0

i just read we can access HttpApplicationState using Application or StaticObjects

I am not clear as why we need two different approach as all i can see is Application will help you to add and read in the code level while using staticobjects we can add it in mark-up of global.asax and read but not update

Is this the only difference or Am I missing some core functionality of static objects

divibisan
  • 11,659
  • 11
  • 40
  • 58

1 Answers1

0

See HttpApplicationState.StaticObjects property:

Application objects are defined in the Global.asax file inside the <object runat="server" scope="Application"> </object> tags.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • 1
    In other words, there is no good reason to use `StaticObjects`. It's a holdover from classic ASP. – John Saunders Mar 22 '14 at 03:36
  • Hi John Can you brief on this how StaticObjects were used in classic ASP I am not able to figure how it works – SIDDU HUSSAIN Mar 24 '14 at 04:36
  • i need this to complete my blog http://www.blog.sidduhussain.com/staticobjects-collection-in-application-state/ – SIDDU HUSSAIN Mar 24 '14 at 04:43
  • Sorry, but I never used them. I just remember that when ASP.NET first came out, there was a list of ASP.NET features and how they corresponded to Classic ASP features. I seem to recall that StaticObjects was on that list. Keep in mind that Classic ASP did not use codebehind and StaticObjects makes better sense. – John Saunders Mar 24 '14 at 05:04