本文整理汇总了C#中RouteCollection.KMap方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.KMap方法的具体用法?C# RouteCollection.KMap怎么用?C# RouteCollection.KMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteCollection
的用法示例。
在下文中一共展示了RouteCollection.KMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterRoutes
public void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.KMap(
"Error",
"View/Default/Error/View_Error_OnError",
new {controller="Error", action="View_Error_OnError",mode="View", theme = "Default", controllerAssembly = "Eshop.Controllers", controllerNamespace = "Eshop.Controllers" },
new { controller = @"[^\.]*" }).RouteHandler =
new KMvcRouteHandler();
routes.KMap(
"Default",
"{mode}/{theme}/{controller}/{action}",
new { controller = "Home", action = "View_Home_Index", mode = "View",theme="Default", controllerAssembly = "Eshop.Controllers", controllerNamespace = "Eshop.Controllers" },
new { controller = @"[^\.]*" }).RouteHandler =
new KMvcRouteHandler();
routes.KMap("LanguageSupported",
"{mode}/{theme}/{lang}/{controller}/{action}",
new { controllerAssembly = "Eshop.Controllers", controllerNamespace = "Eshop.Controllers" }
, new { controller = @"[^\.]*" }).RouteHandler = new KMvcRouteHandler();
FillEnvironmentInfo();
}
示例2: RegisterRoutes
public void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.KMap(
"Authenticate",
"Account/LogOn/{email}/{password}"
, new { controller = "Account", action = "Post_LogOn", controllerAssembly = "Eshop.Controllers", controllerNamespace = "Eshop.Controllers" },
new
{
email =
@"^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$"
}).
RouteHandler =
new KMvcRouteHandler();
routes.KMap(
"Logout",
"Account/Logout/{email}"
, new { controller = "Account", action = "Post_LogOut", controllerAssembly = "Eshop.Controllers", controllerNamespace = "Eshop.Controllers" },
new
{
email =
@"^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$"
}).
RouteHandler =
new KMvcRouteHandler();
routes.KMap(
"RegisterUser",
"Account/Register/{email}/{name}/{password}"
, new { controller = "Account", action = "Post_Register", controllerAssembly = "Eshop.Controllers", controllerNamespace = "Eshop.Controllers" },
new
{
email =
@"^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$"
}).
RouteHandler =
new KMvcRouteHandler();
routes.KMap(
"Default",
"{mode}/{theme}/{controller}/{action}",
new { controller = "Home", action = "View_Index", mode = "View", theme="Default", controllerAssembly = "Eshop.Controllers", controllerNamespace = "Eshop.Controllers" },
new { controller = @"[^\.]*" }).RouteHandler =
new KMvcRouteHandler();
routes.KMap("LanguageSupported",
"{mode}/{theme}/{lang}/{controller}/{action}",
new {theme="Default" , controllerAssembly = "Eshop.Controllers", controllerNamespace = "Eshop.Controllers" }
, new { controller = @"[^\.]*" }).RouteHandler = new KMvcRouteHandler();
FillEnvironmentInfo();
}
示例3: RegisterRoutes
public void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.IgnoreRoute("{resource}.css/{*pathInfo}");
routes.KMap(
"Error",
"View/Default/Error/View_Error_OnError",
new
{
controller = "Error",
action = "View_Error_OnError",
mode = "View",
theme = "Default",
controllerAssembly = "IdehCo.Controllers",
controllerNamespace = "IdehCo.Controllers"
},
new { controller = @"[^\.]*" }).RouteHandler = new KMvcRouteHandler();
routes.KMap(
"Operation",
"{controller}/{action}",
new { controllerAssembly = "IdehCo.Controllers", controllerNamespace = "IdehCo.Controllers" },
new { controller = @"[^\.]*" }).RouteHandler = new KMvcRouteHandler();
routes.KMap(
"HomeLink",
"/Ideh/View/EntranceTheme/{lang}/Entrance/View_Entrance_Index",
new { lang = DependencyResolver.Current.GetService<ICultureHelper>().GetCurrentCulture().Name },
new { controller = @"[^\.]*" }).RouteHandler = new KMvcRouteHandler();
routes.KMap(
"Default",
"{domain}/{mode}/{theme}/{lang}/{controller}/{action}/{id}",
new
{
controller = "Root",
action = "View_Root_Index",
mode = "View",
lang = "fa-IR",
theme = "Default",
controllerAssembly = "IdehCo.Controllers",
controllerNamespace = "IdehCo.Controllers",
domain = "Root",
id = UrlParameter.Optional
},
new { controller = @"[^\.]*" }).RouteHandler = new KMvcRouteHandler();
FillEnvironmentInfo();
}