本文整理汇总了C#中RouteCollection.MapRouteLowercase方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.MapRouteLowercase方法的具体用法?C# RouteCollection.MapRouteLowercase怎么用?C# RouteCollection.MapRouteLowercase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteCollection
的用法示例。
在下文中一共展示了RouteCollection.MapRouteLowercase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRouteLowercase(
name: "TopicPage",
url: "page/{name}",
defaults: new { controller = "TopicPage", action = "Index" },
namespaces: new String[] { "SDNUOJ.Controllers" }
);
routes.MapRouteLowercase(
name: "ProblemStatistic",
url: "problem/statistic/{pid}/{id}/{lang}/{order}",
defaults: new { controller = "Problem", action = "Statistic", id = UrlParameter.Optional, lang = UrlParameter.Optional, order = UrlParameter.Optional },
constraints: new { pid = @"\d+" },
namespaces: new String[] { "SDNUOJ.Controllers" }
);
routes.MapRouteLowercase(
name: "ProblemForum",
url: "problem/forum/{pid}/{id}",
defaults: new { controller = "Forum", action = "Problem", id = UrlParameter.Optional },
constraints: new { pid = @"\d+" },
namespaces: new String[] { "SDNUOJ.Controllers" }
);
routes.MapRouteLowercase(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new String[] { "SDNUOJ.Controllers" }
);
}
示例2: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("Content/*");
routes.IgnoreRoute("{resource}.smh/{*pathInfo}");
routes.MapRouteLowercase(
"NotFound", // Route name
"NotFound", // URL with parameters
new { controller = "Home", action = "NotFound" } // Parameter defaults
);
routes.MapRouteLowercase(
"Forbidden", // Route name
"Forbidden", // URL with parameters
new { controller = "Home", action = "Forbidden" } // Parameter defaults
);
routes.MapRouteLowercase(
"BadRequest", // Route name
"BadRequest", // URL with parameters
new { controller = "Home", action = "BadRequest" } // Parameter defaults
);
routes.MapRouteLowercase(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
示例3: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRouteLowercase(
name: "Tags",
url: "blog/tags/{urlSlug}",
defaults: new { controller = "Blog", action = "Tags", urlSlug = UrlParameter.Optional }
);
routes.MapRouteLowercase(
name: "Archives",
url: "blog/archive/{month}/{year}",
defaults: new { controller = "Blog", action = "Archive", month = UrlParameter.Optional, year = UrlParameter.Optional }
);
routes.MapRouteLowercase(
name: "BlogPost",
url: "blog/{urlSlug}",
defaults: new { controller = "Blog", action = "BlogPost" }
);
routes.MapRouteLowercase(
name: "LoremLewis",
url: "loremlewis",
defaults: new { controller = "Ipsums", action = "LoremLewis" }
);
routes.MapRouteLowercase(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
示例4: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRouteLowercase(
name: "Leads",
url: "Leads/{id}/{order}",
defaults: new { controller = "Lead", action = "Index", id = UrlParameter.Optional, order = UrlParameter.Optional }
);
routes.MapRouteLowercase(
name: "Sales",
url: "Sales/{id}/{order}",
defaults: new { controller = "Sale", action = "Index", id = UrlParameter.Optional, order = UrlParameter.Optional }
);
routes.MapRouteLowercase(
name: "Contacts",
url: "Contacts/{order}",
defaults: new { controller = "Contact", action = "Index", order = UrlParameter.Optional }
);
routes.MapRouteLowercase(
name: "Order",
url: "{controller}/{action}/{id}/{order}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, order = UrlParameter.Optional }
);
routes.MapRouteLowercase(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
示例5: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.MapRouteLowercase(
"Default",
"", // Only matches the empty URL (i.e. ~/)
new { controller = "Search", action = "Index" }
);
routes.MapRouteLowercase(
"Queue",
"Queue/",
new { controller = "Queue", action = "Index" }
);
//routes.MapRouteLowercase("Report", "{controller}/Report/{action}");
routes.MapRouteLowercase(
"SlugsAfterId",
"{controller}/{action}/{id}/{slug}",
new { action = "Edit", slug = "" }
);
routes.MapRouteLowercase(null, "{controller}/{action}");
}
示例6: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRouteLowercase("Admin", "admin", new { controller = "Admin", action = "Index" });
routes.MapRouteLowercase("AppNoodles", "app/{*path}", new { controller = "App", action = "Index" });
routes.MapRouteLowercase("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", Id = null as object });
}
示例7: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRouteLowercase("home index", "", new {controller = "home", action = "index"});
routes.MapRouteLowercase("home about", "about", new {controller = "home", action = "about"});
routes.MapRouteLowercase("default", "{controller}/{action}/{id}", new {action = "index", id = UrlParameter.Optional});
}
示例8: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRouteLowercase("Documentation", "documentation/{view}",
new { controller = "Documentation", action = "Index", id = UrlParameter.Optional });
routes.MapRouteLowercase("Default", "{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional });
}
示例9: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRouteLowercase(
"topic", // Route name
"topic/{topic}/{id}", // URL with parameters
new { controller = "topic", action = "blog", id = "1" } // Parameter defaults
);
routes.MapRouteLowercase(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
示例10: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//routes.MapRouteLowercase(
// "root_default",
// "",
// new { area= "wedding", controller = "Home", action = "Index", id = UrlParameter.Optional },
// new string[] { "Wedding.Areas.wedding.Controllers" }
// );
routes.MapRouteLowercase(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new string[] { "Wedding.Controllers" }
);
//routes.MapRouteLowercase(
// "Default", // Route name
// "wedding/{controller}/{action}/{id}", // URL with parameters
// new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
// new string[] { "Wedding.Areas.wedding.Controllers" }
//);
}
示例11: RegisterViewRoutes
internal static void RegisterViewRoutes(RouteCollection routes)
{
routes.MapRouteLowercase(
"Default", "{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new { id = UrlConstraint.OptionalNumeric });
}
示例12: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*robotstxt}", new { robotstxt = @"(.*/)?robots.txt(/.*)?" });
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.MapRouteLowercase(
name: "WithSeasonNumber",
url: "{controller}/{action}/{seriesId}/{seasonNumber}"
);
routes.MapRouteLowercase(
name: "SeriesId",
url: "{controller}/{action}/{seriesId}",
defaults: new { controller = "Series", action = "Index", seriesId = UrlParameter.Optional }
);
}
示例13: Register
public void Register(RouteCollection Routes)
{
// Error Routes
Routes.MapRouteLowercase(
"Generic Error",
"Error/{action}",
new { controller = "Error", action = "Index" },
new { controller = "Error" }
);
// Catch all
Routes.MapRouteLowercase(
"Error",
"{*url}",
new { controller = "Error", action = "NotFound" }
);
}
示例14: Register
public void Register(RouteCollection Routes)
{
// Generic Actions
Routes.MapRouteLowercase(
"Generic pages for site",
"{action}",
new { controller = "Public" },
new { controller = "Public", action = "(FAQ|About)" }
);
// Default route
Routes.MapRouteLowercase(
"Landing Page",
"",
new {controller = "Public", action = "Home", page = 1}
);
}
示例15: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRouteLowercase("home index", "", new {controller = "home", action = "index"});
routes.MapRouteLowercase("home about", "about", new {controller = "home", action = "about"});
routes.MapRouteLowercase("home throw", "throw", new {controller = "home", action = "throw"});
routes.MapRouteLowercase("account", "account/{action}/{id}", new {controller = "account", action = "manage", id = UrlParameter.Optional});
routes.MapRouteLowercase("admin", "admin/{action}/{id}", new {controller = "admin", action = "index", id = UrlParameter.Optional});
routes.MapRouteLowercase("ping", "ping/{action}/{id}", new {controller = "ping", action = "index", id = UrlParameter.Optional});
routes.MapRouteLowercase("shopping lists add", "add", new {controller = "shoppinglists", action = "add"});
routes.MapRouteLowercase("shopping lists index", "{username}", new {controller = "shoppinglists", action = "index"});
routes.MapRouteLowercase("shopping list add item", "{username}/{shoppinglist}/add/{action}", new {controller = "addlistitem", action = "index"});
routes.MapRouteLowercase("shopping lists", "{username}/{shoppinglist}/{action}/{id}", new {controller = "shoppinglists", action = "show", id = UrlParameter.Optional});
}