IHtmlGenerator.GenerateRouteForm 方法

定義

<產生表單 > 專案。 具有名稱 routeName 的路由會產生 < 表單 > 的 action 屬性值。

public:
 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
Public Function GenerateRouteForm (viewContext As ViewContext, routeName As String, routeValues As Object, method As String, htmlAttributes As Object) As TagBuilder

參數

viewContext
ViewContext

ViewContext目前範圍的實例。

routeName
String

路由的名稱。

routeValues
Object

Object,包含路由的參數。 參數會透過反映來擷取,方法是檢查 的屬性 Object 。 這 Object 通常是使用 Object 初始化運算式語法所建立。 或者,包含 IDictionary<TKey,TValue> 路由參數的實例。

method
String

用於處理此表單的 HTTP 方法。可以是 GET 或 POST。

htmlAttributes
Object

Object,包含 專案的 HTML 屬性。 或者,包含 IDictionary<TKey,TValue> HTML 屬性的實例。

傳回

TagBuilder/form > 專案的實例 < 。

適用於