本文整理汇总了C#中System.Web.Mvc.AreaRegistrationContext.CultureMapRoute方法的典型用法代码示例。如果您正苦于以下问题:C# AreaRegistrationContext.CultureMapRoute方法的具体用法?C# AreaRegistrationContext.CultureMapRoute怎么用?C# AreaRegistrationContext.CultureMapRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.AreaRegistrationContext
的用法示例。
在下文中一共展示了AreaRegistrationContext.CultureMapRoute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterArea
public override void RegisterArea(AreaRegistrationContext context)
{
context.CultureMapRoute(
"Admin_default",
"Admin/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
示例2: RegisterArea
public override void RegisterArea(AreaRegistrationContext context)
{
context.CultureMapRoute(
"Api_default",
"Api/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional },
new string[] { "Worki.Web.Areas.Api.Controllers" }
);
// Register REST api routes within path /api
//RestRoutes.RegisterRoutes(context, "/api");
}
示例3: RegisterArea
public override void RegisterArea(AreaRegistrationContext context)
{
//home mobile
context.CultureMapRoute(
"",
"mobile",
new { controller = "Home", action = "Index" },
new string[] { "Worki.Web.Areas.Mobile.Controllers" }
);
context.CultureMapRoute(
"", // Nom d'itinéraire
"mobile/workplaces/{action}/{id}", // URL avec des paramètres
new { controller = "Localisation", action = "Index", id = UrlParameter.Optional }, // Paramètres par défaut
new string[] { "Worki.Web.Areas.Mobile.Controllers" }
);
context.CultureMapRoute(
"Mobile_default",
"mobile/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
示例4: RegisterArea
public override void RegisterArea(AreaRegistrationContext context)
{
context.CultureMapRoute(
"Widget_default",
"Widget/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
var routes = context.Routes;
for (var i = 0; i < routes.Count; i++)
{
var route = routes[i];
if (route.GetAreaToken() != "Widget")
continue;
routes[i] = new QueryPropagatingRoute(route, MiscHelpers.WidgetConstants.ParamToKeep);
}
}