[AttributeUsage(AttributeTargets
public sealed class SessionStateAttribute : Attribute
{
public SessionStateAttribute(SessionStateBehavior behavior)
public SessionStateBehavior Behavior { get; }
}
DefaultControllerFactory會試著獲取應用在Controller類型上的SessionStateAttribute特性
public class ReflectedControllerFactory : IControllerFactory
{
//其他成員
public SessionStateBehavior GetControllerSessionBehavior(
RequestContext requestContext
{
Type controllerType = this
controllerName)
if (null == controllerType)
{
return SessionStateBehavior
}
SessionStateAttribute attribute = controllerType
attributeattribute = attribute ??
new SessionStateAttribute(SessionStateBehavior
return attribute
}
}
返回目錄
編輯推薦
ASP
Microsoft
Java程序性能優化
Visual C++音頻/視頻技術開發與實戰
[
From:http://tw.wingwit.com/Article/program/net/201311/16080.html