IHtmlGenerator.GenerateForm 方法

定義

<產生表單 > 專案。 當使用者提交表單時,具有名稱 actionName 的動作將會處理要求。

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

參數

viewContext
ViewContext

ViewContext目前範圍的實例。

actionName
String

動作方法的名稱。

controllerName
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 > 專案的實例 < 。

適用於