共用方式為


PageConventionCollection.AddAreaPageApplicationModelConvention 方法

定義

建立並新增 , IPageApplicationModelConvention 以針對位於指定區域之指定名稱的頁面叫用 動作 PageApplicationModel

public:
 Microsoft::AspNetCore::Mvc::ApplicationModels::IPageApplicationModelConvention ^ AddAreaPageApplicationModelConvention(System::String ^ areaName, System::String ^ pageName, Action<Microsoft::AspNetCore::Mvc::ApplicationModels::PageApplicationModel ^> ^ action);
public Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelConvention AddAreaPageApplicationModelConvention (string areaName, string pageName, Action<Microsoft.AspNetCore.Mvc.ApplicationModels.PageApplicationModel> action);
member this.AddAreaPageApplicationModelConvention : string * string * Action<Microsoft.AspNetCore.Mvc.ApplicationModels.PageApplicationModel> -> Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelConvention
Public Function AddAreaPageApplicationModelConvention (areaName As String, pageName As String, action As Action(Of PageApplicationModel)) As IPageApplicationModelConvention

參數

areaName
String

區域的名稱。

pageName
String

頁面名稱,例如 /Users/List

頁面名稱是不含副檔名的檔案路徑,相對於指定區域的 pages 根目錄。 例如,Areas/Identity/Pages/Manage/Accounts.cshtml 檔案的頁面名稱是 /Manage/Accounts

傳回

加入 IPageApplicationModelConvention 的 。

適用於