Dela via


DefaultHtmlGenerator.GenerateRouteForm Method

Definition

Generate a <form> element. The route with name routeName generates the <form>'s action attribute value.

public:
 virtual Microsoft::AspNetCore::Mvc::Rendering::TagBuilder ^ GenerateRouteForm(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, System::String ^ routeName, System::Object ^ routeValues, System::String ^ method, System::Object ^ htmlAttributes);
public Microsoft.AspNetCore.Mvc.Rendering.TagBuilder GenerateRouteForm (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, string routeName, object routeValues, string method, object htmlAttributes);
abstract member GenerateRouteForm : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * string * obj * string * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
override this.GenerateRouteForm : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * string * obj * string * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
Public Function GenerateRouteForm (viewContext As ViewContext, routeName As String, routeValues As Object, method As String, htmlAttributes As Object) As TagBuilder

Parameters

viewContext
ViewContext

A ViewContext instance for the current scope.

routeName
String

The name of the route.

routeValues
Object

An Object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the Object. This Object is typically created using Object initializer syntax. Alternatively, an IDictionary<TKey,TValue> instance containing the route parameters.

method
String

The HTTP method for processing the form, either GET or POST.

htmlAttributes
Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

Returns

A TagBuilder instance for the </form> element.

Implements

Applies to