过滤器之一authorization

Technorati 标签: asp.net mvc2
public class ControllerContext

System.Web.Mvc 的成员

摘要: Encapsulates information about an HTTP request that matches specified System.Web.Routing.RouteBase and System.Web.Mvc.ControllerBase instances.

封装对应于指定sysytem,web.routing.routebase和system.web.mvc.controllerbase实例的http请求的信息,

public class ControllerContext { // Fields private HttpContextBasehttpContext; private RequestContextrequestContext; private RouteDatarouteData; [CompilerGenerated] private ControllerBasekBackingField; internal const stringPARENTACTION_VIEWCONTEXT = "ParentActionViewContext"; // Methods public ControllerContext(); protected ControllerContext(ControllerContext controllerContext); public ControllerContext(RequestContext requestContext, ControllerBase controller); public ControllerContext(HttpContextBase httpContext, RouteData routeData, ControllerBase controller); // Properties public virtual ControllerBaseController { [CompilerGenerated] get; [CompilerGenerated] set; } public virtual HttpContextBaseHttpContext { get; set; } public virtual boolIsChildAction { get; } public ViewContextParentActionViewContext { get; } public RequestContextRequestContext { get; set; } public virtual RouteDataRouteData { get; set; } ---------------------------------------------------------------------------

Gets or sets the URL route data.

Return Value

The URL route data.

===========================================================================

public virtual RouteDataRouteData { get { if (this.routeData null) { this.routeData = (this.requestContext != null) ? this.requestContext.RouteData : new RouteData(); } return this.routeData; } set { this.routeData = value; } }

======================================================================= // Nested Types private sealed class EmptyHttpContext : HttpContextBase { // Methods public EmptyHttpContext(); } }

======================

AuthorizeAttribute 继承与ControllerContext

Encapsulates the information that is required for using an AuthorizeAttribute attribute.

封装信息,使用AuthorizeAttribute 属性的请求信息.