RequestContext RequestContext RequestContext RequestContext Class

定义

封装与所定义路由匹配的 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
继承
RequestContextRequestContextRequestContextRequestContext

注解

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

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

构造函数

RequestContext() RequestContext() RequestContext() RequestContext()

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

RequestContext(HttpContextBase, RouteData) RequestContext(HttpContextBase, RouteData) RequestContext(HttpContextBase, RouteData) RequestContext(HttpContextBase, RouteData)

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

属性

HttpContext HttpContext HttpContext HttpContext

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

RouteData RouteData RouteData RouteData

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

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

适用于

另请参阅