PageConventionCollection.AddAreaPageRouteModelConvention 方法

定义

创建并添加一个 , IPageRouteModelConvention 用于为指定名称位于指定区域中的页面在 上调用操作 PageRouteModel

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

参数

areaName
String

区域名称。

pageName
String

页面名称,例如 /Users/List

页面名称是没有扩展名的文件的路径,相对于指定区域的页根目录。 例如,文件 Areas/Identity/Pages/Manage/Accounts.cshtml 的页面名称为 /Manage/Accounts

返回

添加了 IPageRouteModelConvention

适用于