Sdílet prostřednictvím


System.Web.Mvc Namespace

The System.Web.Mvc namespace contains classes and interfaces that support the ASP.NET Model View Controller (MVC) framework for creating Web applications. This namespace includes classes that represent controllers, controller factories, action results, views, partial view, model binders, and much more.

Classes

  Class Description
Public class AcceptVerbsAttribute Represents an attribute that specifies which HTTP verbs an action method will respond to.
Public class ActionDescriptor Provides information about an action method, such as its name, controller, parameters, attributes, and filters.
Public class ActionExecutedContext Provides the context for the ActionExecuted method of the ActionFilterAttribute class.
Public class ActionExecutingContext Provides the context for the ActionExecuting method of the ActionFilterAttribute class.
Public class ActionFilterAttribute Represents the base class for all action-filter attributes.
Public class ActionMethodSelectorAttribute Represents an attribute that is used to influence the selection of an action method.
Public class ActionNameAttribute Represents an attribute that is used for the name of an action.
Public class ActionNameSelectorAttribute Represents an attribute that affects the selection of an action method.
Public class ActionResult Encapsulates the result of an action method and is used to perform a framework-level operation on behalf of the action method.
Public class AjaxHelper Represents support for rendering HTML in AJAX scenarios within a view.
Public class AjaxHelper<TModel> Represents support for rendering HTML in AJAX scenarios within a strongly typed view.
Public class AjaxRequestExtensions Represents a class that extends the HttpRequestBase class by adding the ability to determine whether an HTTP request is an AJAX request.
Public class AreaRegistration Provides a way to register one or more areas in an ASP.NET MVC application.
Public class AreaRegistrationContext Encapsulates the information that is required in order to register an area within an ASP.NET MVC application.
Public class AssociatedMetadataProvider Provides an abstract class to implement a metadata provider.
Public class AssociatedValidatorProvider Provides an abstract class for classes that implement a validation provider.
Public class AsyncController Provides the base class for asynchronous controllers.
Public class AsyncTimeoutAttribute Represents an attribute that is used to set the timeout value, in milliseconds, for an asynchronous method.
Public class AuthorizationContext Encapsulates the information that is required for using an AuthorizeAttribute attribute.
Public class AuthorizeAttribute Represents an attribute that is used to restrict access by callers to an action method.
Public class BindAttribute Represents an attribute that is used to provide details about how model binding to a parameter should occur.
Public class ByteArrayModelBinder Maps a browser request to a byte array.
Public class ChildActionOnlyAttribute Represents an attribute that is used to indicate that an action method should be called only as a child action.
Public class ClientDataTypeModelValidatorProvider Returns the client data-type model validators.
Public class ContentResult Represents a user-defined content type that is the result of an action method.
Public class Controller Provides methods that respond to HTTP requests that are made to an ASP.NET MVC Web site.
Public class ControllerActionInvoker Represents a class that is responsible for invoking the action methods of a controller.
Public class ControllerBase Represents the base class for all MVC controllers.
Public class ControllerBuilder Represents a class that is responsible for dynamically building a controller.
Public class ControllerContext Encapsulates information about an HTTP request that matches specified RouteBase and ControllerBase instances.
Public class ControllerDescriptor Encapsulates information that describes a controller, such as its name, type, and actions.
Public class CustomModelBinderAttribute Represents an attribute that invokes a custom model binder.
Public class DataAnnotationsModelMetadata Provides a container for common metadata, for the DataAnnotationsModelMetadataProvider class, and for the DataAnnotationsModelValidator class for a data model.
Public class DataAnnotationsModelMetadataProvider Implements the default model metadata provider for ASP.NET MVC.
Public class DataAnnotationsModelValidator Provides a model validator.
Public class DataAnnotationsModelValidator<TAttribute> Provides a model validator for a specified validation type.
Public class DataAnnotationsModelValidatorProvider Implements the default validation provider for MVC.
Public class DataErrorInfoModelValidatorProvider Provides a container for the error-information model validator.
Public class DefaultControllerFactory Represents the controller factory that is registered by default.
Public class DefaultModelBinder Maps a browser request to a data object. This class provides a concrete implementation of a model binder.
Public class DefaultViewLocationCache Represents a memory cache for view locations.
Public class DictionaryValueProvider<TValue> Represents the base class for value providers whose values come from a collection that implements the IDictionary<TKey, TValue> interface.
Public class EmptyModelMetadataProvider Provides an empty metadata provider for data models that do not require metadata.
Public class EmptyModelValidatorProvider Provides an empty validation provider for models that do not require a validator.
Public class EmptyResult Represents a result that does nothing, such as a controller action method that returns nothing.
Public class ExceptionContext Provides the context for using the HandleErrorAttribute class.
Public class ExpressionHelper Provides a helper class to get the model name from an expression.
Public class FieldValidationMetadata Provides a container for client-side field validation metadata.
Public class FileContentResult Sends the contents of a binary file to the response.
Public class FilePathResult Sends the contents of a file to the response.
Public class FileResult Represents a base class that is used to send binary file content to the response.
Public class FileStreamResult Sends binary content to the response by using a Stream instance.
Public class FilterAttribute Represents the base class for action-filter attributes.
Public class FilterInfo Encapsulates information about the available action filters.
Public class FormCollection Contains the form value providers for the application.
Public class FormContext Encapsulates information that is required in order to validate and process the input data from an HTML form.
Public class FormValueProvider Represents a value provider for form values that are contained in a NameValueCollection object.
Public class FormValueProviderFactory Represents a class that is responsible for creating a new instance of a form-value provider object.
Public class HandleErrorAttribute Represents an attribute that is used to handle an exception that is thrown by an action method.
Public class HandleErrorInfo Encapsulates information for handling an error that was thrown by an action method.
Public class HiddenInputAttribute Represents an attribute that is used to indicate whether a property or field value should be rendered as a hidden input element.
Public class HtmlHelper Represents support for rendering HTML controls in a view.
Public class HtmlHelper<TModel> Represents support for rendering HTML controls in a strongly typed view.
Public class HttpAntiForgeryException Represents an HTTP anti-forgery exception.
Public class HttpDeleteAttribute Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests.
Public class HttpFileCollectionValueProvider Represents a value provider to use with values that come from a collection of HTTP files.
Public class HttpFileCollectionValueProviderFactory Represents a class that is responsible for creating a new instance of an HTTP file collection value provider object.
Public class HttpGetAttribute Represents an attribute that is used to restrict an action method so that the method handles only HTTP GET requests.
Public class HttpPostAttribute Represents an attribute that is used to restrict an action method so that the method handles only HTTP POST requests.
Public class HttpPostedFileBaseModelBinder Binds a model to a posted file.
Public class HttpPutAttribute Represents an attribute that is used to restrict an action method so that the method handles only HTTP PUT requests.
Public class HttpRequestExtensions Extends the HttpRequestBase class that contains the HTTP values that were sent by a client during a Web request.
Public class HttpUnauthorizedResult Represents the result of an unauthorized HTTP request.
Public class JavaScriptResult Sends JavaScript content to the response.
Public class JsonResult Represents a class that is used to send JSON-formatted content to the response.
Public class LinqBinaryModelBinder Maps a browser request to a LINQ Binary object.
Public class ModelBinderAttribute Represents an attribute that is used to associate a model type to a model-builder type.
Public class ModelBinderDictionary Represents a class that contains all model binders for the application, listed by binder type.
Public class ModelBinders Provides global access to the model binders for the application.
Public class ModelBindingContext Provides the context in which a model binder functions.
Public class ModelClientValidationRangeRule Provides a container for a range-validation rule that is sent to the browser.
Public class ModelClientValidationRegexRule Provides a container for a regular-expression client validation rule that is sent to the browser.
Public class ModelClientValidationRequiredRule Provides a container for client validation for required field.
Public class ModelClientValidationRule Provides a base class container for a client validation rule that is sent to the browser.
Public class ModelClientValidationStringLengthRule Provides a container for a string-length validation rule that is sent to the browser.
Public class ModelError Represents an error that occurs during model binding.
Public class ModelErrorCollection A collection of ModelError instances.
Public class ModelMetadata Provides a container for common metadata, for the ModelMetadataProvider class, and for the ModelValidator class for a data model.
Public class ModelMetadataProvider Provides an abstract base class for a custom metadata provider.
Public class ModelMetadataProviders Provides a container for the current ModelMetadataProvider instance.
Public class ModelState Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself.
Public class ModelStateDictionary Represents the state of an attempt to bind a posted form to an action method, which includes validation information.
Public class ModelValidationResult Provides a container for a validation result.
Public class ModelValidator Provides a base class for implementing validation logic.
Public class ModelValidatorProvider Provides a list of validators for a model.
Public class ModelValidatorProviderCollection Provides a container for a list of validation providers.
Public class ModelValidatorProviders Provides a container for the current validation provider.
Public class MultiSelectList Represents a list of items that users can select more than one item from.
Public class MvcHandler Selects the controller that will handle an HTTP request.
Public class MvcHtmlString Represents an HTML-encoded string that should not be encoded again.
Public class MvcHttpHandler Verifies and processes an HTTP request.
Public class MvcRouteHandler Creates an object that implements the IHttpHandler interface and gives it the request context.
Public class NameValueCollectionExtensions Extends a NameValueCollection object so that the collection can be copied to a specified dictionary.
Public class NameValueCollectionValueProvider Represents the base class for value providers whose values come from a NameValueCollection object.
Public class NoAsyncTimeoutAttribute Provides a convenience wrapper for the AsyncTimeoutAttribute attribute.
Public class NonActionAttribute Represents an attribute that is used to indicate that a controller method is not an action method.
Public class OutputCacheAttribute Represents an attribute that is used to mark an action method whose output will be cached.
Public class ParameterBindingInfo Encapsulates information for binding action-method parameters to a data model.
Public class ParameterDescriptor Contains information that describes a parameter.
Public class PartialViewResult Represents a base class that is used to send a partial view to the response.
Public class QueryStringValueProvider Represents a value provider for query strings that are contained in a NameValueCollection object.
Public class QueryStringValueProviderFactory Represents a class that is responsible for creating a new instance of a query-string value-provider object.
Public class RangeAttributeAdapter Provides an adapter for the RangeAttribute attribute.
Public class RedirectResult Controls the processing of application actions by redirecting to a specified URI.
Public class RedirectToRouteResult Represents a result that performs a redirection by using the specified route values dictionary.
Public class ReflectedActionDescriptor Contains information that describes a reflected action method.
Public class ReflectedControllerDescriptor Contains information that describes a reflected controller.
Public class ReflectedParameterDescriptor Contains information that describes a reflected action-method parameter.
Public class RegularExpressionAttributeAdapter Provides an adapter for the RegularExpressionAttribute attribute.
Public class RequiredAttributeAdapter Provides an adapter for the RequiredAttributeAttribute attribute.
Public class RequireHttpsAttribute Represents an attribute that forces an unsecured HTTP request to be re-sent over HTTPS.
Public class ResultExecutedContext Provides the context for the OnResultExecuted method of the ActionFilterAttribute class.
Public class ResultExecutingContext Provides the context for the OnResultExecuting method of the ActionFilterAttribute class.
Public class RouteCollectionExtensions Extends a RouteCollection object for MVC routing.
Public class RouteDataValueProvider Represents a value provider for route data that is contained in an object that implements the IDictionary<TKey, TValue> interface.
Public class RouteDataValueProviderFactory Represents a factory for creating route-data value provider objects.
Public class SelectList Represents a list that lets users select one item.
Public class SelectListItem Represents the selected item in an instance of the SelectList class.
Public class SessionStateTempDataProvider Provides session-state data to the current TempDataDictionary object.
Public class StringLengthAttributeAdapter Provides an adapter for the StringLengthAttribute attribute.
Public class TagBuilder Represents a class that is used by HTML helpers to build HTML elements.
Public class TempDataDictionary Represents a set of data that persists only from one request to the next.
Public class TemplateInfo Encapsulates information about the current template context.
Public class UrlHelper Contains methods to build URLs for ASP.NET MVC within an application.
Public class UrlParameter Represents an optional parameter that is used by the MvcHandler class during routing.
Public class ValidateAntiForgeryTokenAttribute Represents an attribute that is used to detect whether a server request has been tampered with.
Public class ValidateInputAttribute Represents an attribute that is used to mark action methods whose input must be validated.
Public class ValueProviderCollection Represents the collection of value-provider objects for the application.
Public class ValueProviderDictionary Obsolete. Represents a dictionary of value providers for the application.
Public class ValueProviderFactories Represents a container for value-provider factory objects.
Public class ValueProviderFactory Represents a factory for creating value-provider objects.
Public class ValueProviderFactoryCollection Represents the collection of value-provider factories for the application.
Public class ValueProviderResult Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself.
Public class ViewContext Encapsulates information that is related to rendering a view.
Public class ViewDataDictionary Represents a container that is used to pass data between a controller and a view.
Public class ViewDataDictionary<TModel> Represents a container that is used to pass strongly typed data between a controller and a view.
Public class ViewDataInfo Encapsulates information about the current template content that is used to develop templates and about HTML helpers that interact with templates.
Public class ViewEngineCollection Represents a collection of view engines that are available to the application.
Public class ViewEngineResult Represents the result of locating a view engine.
Public class ViewEngines Represents a collection of view engines that are available to the application.
Public class ViewMasterPage Represents the information that is needed to build a master view page.
Public class ViewMasterPage<TModel> Represents the information that is required in order to build a strongly typed master view page.
Public class ViewPage Represents the properties and methods that are needed to render a view as a Web Forms page.
Public class ViewPage<TModel> Represents the information that is required in order to render a strongly typed view as a Web Forms page.
Public class ViewResult Represents a class that is used to render a view by using an IView instance that is returned by an IViewEngine object.
Public class ViewResultBase Represents a base class that is used to provide the model to the view and then render the view to the response.
Public class ViewTemplateUserControl Provides a container for TemplateInfo objects.
Public class ViewTemplateUserControl<TModel> Provides a container for TemplateInfo objects.
Public class ViewType Represents the type of a view.
Public class ViewUserControl Represents the information that is needed to build a user control.
Public class ViewUserControl<TModel> Represents the information that is required in order to build a strongly typed user control.
Public class VirtualPathProviderViewEngine Represents an abstract base-class implementation of the IViewEngine interface.
Public class WebFormView Represents the information that is needed to build a Web Forms page in MVC.
Public class WebFormViewEngine Represents a view engine that is used to render a Web Forms page to the response.

Interfaces

  Interface Description
Public interface IActionFilter Defines the methods that are used in an action filter.
Public interface IActionInvoker Defines the contract for an action invoker, which is used to invoke an action in response to an HTTP request.
Public interface IAuthorizationFilter Defines the methods that are required for an authorization filter.
Public interface IController Defines the methods that are required for a controller.
Public interface IControllerFactory Defines the methods that are required for a controller factory.
Public interface IExceptionFilter Defines the methods that are required for an exception filter.
Public interface IModelBinder Defines the methods that are required for a model binder.
Public interface IResultFilter Defines the methods that are required for a result filter.
Public interface IRouteWithArea Associates a route with an area in an ASP.NET MVC application.
Public interface ITempDataProvider Defines the contract for temporary-data providers that store data that is viewed on the next request.
Public interface IValueProvider Defines the methods that are required for a value provider in ASP.NET MVC.
Public interface IView Defines the methods that are required for a view.
Public interface IViewDataContainer Defines the methods that are required for a view data dictionary.
Public interface IViewEngine Defines the methods that are required for a view engine.
Public interface IViewLocationCache Defines the methods that are required in order to cache view locations in memory.

Delegates

  Delegate Description
Public delegate ActionSelector Represents a delegate that contains the logic for selecting an action method.
Public delegate DataAnnotationsModelValidationFactory Represents the method that creates a DataAnnotationsModelValidatorProvider instance.

Enumerations

  Enumeration Description
Public enumeration FormMethod Enumerates the HTTP request types for a form.
Public enumeration HttpVerbs Enumerates the HTTP verbs.
Public enumeration InputType Enumerates the types of input controls.
Public enumeration JsonRequestBehavior Specifies whether HTTP GET requests from the client are allowed.
Public enumeration TagRenderMode Enumerates the modes that are available for rendering HTML tags.

See Also

Reference

System.Web.Mvc.Ajax

System.Web.Mvc.Async

System.Web.Mvc.Html