RequestContext 类

定义

封装有关与已定义路由匹配的 HTTP 请求的信息。Encapsulates information about an HTTP request that matches a defined route.

public ref class RequestContext
public class RequestContext
type RequestContext = class
Public Class RequestContext
继承
RequestContext

注解

RequestContext类在属性中包含有关 HTTP 请求的信息 HttpContextThe RequestContext class contains information about the HTTP request in the HttpContext property. 它包含有关与属性中的当前请求匹配的路由的信息 RouteDataIt contains information about the route that matched the current request in the RouteData property.

从路由构造 URL 时,会将类的实例传递 RequestContextRouteCollection.GetVirtualPath 方法。When you construct a URL from a route, you pass an instance of the RequestContext class to the RouteCollection.GetVirtualPath method.

构造函数

RequestContext()

初始化 RequestContext 类的新实例。Initializes a new instance of the RequestContext class.

RequestContext(HttpContextBase, RouteData)

初始化 RequestContext 类的新实例。Initializes a new instance of the RequestContext class.

属性

HttpContext

获取有关 HTTP 请求的信息。Gets information about the HTTP request.

RouteData

获取关于请求的路由的信息。Gets information about the requested route.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅