那位大虾能帮我解释一下
[C#]
// C# code from within a page, a handler, or Global.asax.
Session.Contents["Message"] = "MyMsg";
Session.Contents["AppStartTime"] = DateTime.Now;
The StaticObjects collection exposes all variable items that have been added to the session-state collection through <object runat="server"> tags with the scope of "Session" within the Global.asax file. For example:
' Global.asax definition.
<OBJECT RUNAT="SERVER" SCOPE="SESSION" ID="MyInfo" PROGID="Scripting.Dictionary">
</OBJECT>
Objects cannot be added to the StaticObjects collection from anywhere else within an ASP.NET application. The collection throws a NotSupportedException if users attempt to add objects directly through code.
Note The ASP.NET page compiler automatically injects member references into all objects stored within the StaticObjects collection at page compilation time.
Page developers can access Session objects directly at page request time without having to go through the StaticObjects collection, as shown in the following example:
<html>
</body>
Number of entries: <%= MyInfo.Count %>
<body>
</html>
最近一个项目要调查这个asp.net的state
在msdn中看到上文所提到的StaticObjects 和 NotSupportedException这2个概念,想请熟悉的大哥,帮帮小弟,解释一下什么是StaticObjects和,如果让那个NotSupportedException出现
务必帮忙,不胜感激