本文整理汇总了C#中RouteCollection.MapLowerCaseRoute方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.MapLowerCaseRoute方法的具体用法?C# RouteCollection.MapLowerCaseRoute怎么用?C# RouteCollection.MapLowerCaseRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteCollection
的用法示例。
在下文中一共展示了RouteCollection.MapLowerCaseRoute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapLowerCaseRoute(
"Access",
"access/{action}/{key}",
new { controller = "access" },
new { action = "(grant|revoke|impersonate)", key = "" }
);
routes.MapLowerCaseRoute(
"Login",
"login/{action}",
new { controller = "access", action = "login" }
);
routes.MapLowerCaseRoute(
"Ajax",
"ajax/{action}",
new { controller = "album" },
new { action = "(standardnames)" }
);
routes.MapRoute(
"Album Action",
"{albumID}/{action}",
new { controller = "album" },
new { action = "download" }
);
routes.MapRoute(
"Item Action",
"{album}/{item}/{action}",
new { controller = "albumitem" },
new { action = "(view|proposedelete|revertdelete)" }
);
DependencyResolver.Current.GetService<Logic.IImageRequestStrategy>()
.MapRoute(routes, "Image", "Get");
routes.MapRoute(
"Home",
"{album}",
new { controller = "album", action = "gallery", album = "" }
);
routes.MapRoute(
"OpenIdDiscover",
"login/openiddiscover",
new { controller = "access", action = "discover" }
);
}
示例2: RegisterRoutes
protected override void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapLowerCaseRoute(
"Default",
"{controller}/{action}"
);
}
示例3: RegisterRoutes
protected override void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapLowerCaseRoute(
"Default",
"",
new { controller = "Wiki", action = "Main", Slug = "root" }
);
routes.MapRoute(
"Wiki",
"wiki/{slug}",
new { controller = "Wiki", action = "Main" }
);
}
示例4: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*allaxd}", new { allaxd = @".*\.axd(/.*)?" });
routes.IgnoreRoute("pingback");
// Login
routes.MapRoute(
name: "Login",
url: "login",
defaults: new { controller = "Login", action = "Index" },
namespaces: new[] { typeof(LoginController).Namespace }
);
routes.MapRoute(
name: "Login.Return",
url: "login/return",
defaults: new { controller = "Login", action = "Return" },
namespaces: new[] { typeof(LoginController).Namespace }
);
// Feeds
routes.MapLowerCaseRoute("feed", new { controller = "Feed", action = "Feed", feedName = (string)null });
routes.MapLowerCaseRoute("feeds/{*feedName}", new { controller = "Feed", action = "Feed" });
routes.MapLowerCaseRoute("commentfeed", new { controller = "Feed", action = "CommentFeed" });
// Upload
routes.MapLowerCaseRoute("get/{*path}", new { controller = "Upload", action = "Render", area = "Admin" });
// Resources
routes.MapLowerCaseRoute("content/theme.css", new { controller = "Resource", action = "RenderThemedFileIfExists", fileToRender = "{Theme}/Content/Styles/Theme.css", contentType = "text/css" });
routes.MapLowerCaseRoute("robots", new { controller = "Resource", action = "Render", fileName = "Content/Resources/Robots.txt", contentType = "text/plain" });
routes.MapLowerCaseRoute("robots.txt", new { controller = "Resource", action = "Render", fileName = "Content/Resources/Robots.txt", contentType = "text/plain" });
routes.MapLowerCaseRoute("humans.txt", new { controller = "Resource", action = "Render", fileName = "Content/Resources/Humans.txt", contentType = "text/plain" });
routes.MapLowerCaseRoute("humans", new { controller = "Resource", action = "Render", fileName = "Content/Resources/Humans.txt", contentType = "text/plain" });
routes.MapLowerCaseRoute("favicon", new { controller = "Resource", action = "Render", fileName = "{Theme}/Content/Images/favicon.ico", fileName2 = "Content/Resources/favicon.ico", contentType = "image/vnd.microsoft.icon" });
routes.MapLowerCaseRoute("favicon.ico", new { controller = "Resource", action = "Render", fileName = "{Theme}/Content/Images/favicon.ico", fileName2 = "Content/Resources/favicon.ico", contentType = "image/vnd.microsoft.icon" });
routes.MapLowerCaseRoute("favicon.png", new { controller = "Resource", action = "Render", fileName = "{Theme}/Content/Images/favicon.png", fileName2 = "Content/Resources/favicon.png", contentType = "image/png" });
routes.MapLowerCaseRoute("status", new { controller = "Resource", action = "Render", fileName = "Content/Resources/Status.html", contentType = "text/html" });
// Site Map
routes.MapLowerCaseRoute("sitemap", new { controller = "Wiki", action = "SiteMap" });
routes.MapLowerCaseRoute("sitemap.xml", new { controller = "Wiki", action = "SiteMap" });
// Tags
routes.MapLowerCaseRoute("tag/{*tagName}", new { controller = "Tag", action = "Index" });
// Tagged Pages
routes.MapLowerCaseRoute("tagged/{*tag}", new { controller = "Tagged", action = "Index" });
// Wiki
routes.MapLowerCaseRoute("blog", new { controller = "Wiki", action = "Recent", pageNumber = "0" });
routes.MapLowerCaseRoute("blog/{pageNumber}", new { controller = "Wiki", action = "Recent" }, new { pageNumber = "\\d+" });
routes.MapLowerCaseRoute("", new { controller = "Wiki", action = "Home", pageNumber = "0" });
routes.MapLowerCaseRoute("{pageNumber}", new { controller = "Wiki", action = "Home" }, new { pageNumber = "\\d+" });
routes.MapLowerCaseRoute("search", new { controller = "Wiki", action = "Search" });
routes.MapLowerCaseRoute("unpublished", new { controller = "WikiAdmin", Area = "Admin", action = "Unpublished" });
routes.MapLowerCaseRoute("admin/new", new { controller = "WikiAdmin", Area = "Admin", action = "Edit", page = "" });
routes.MapLowerCaseRoute("edit/{*page}", new { controller = "WikiAdmin", Area = "Admin", action = "Edit", page = UrlParameter.Optional });
routes.MapLowerCaseRoute("revert/{*page}", new { controller = "WikiAdmin", Area = "Admin", action = "Revert" });
routes.MapLowerCaseRoute("via-feed/{*page}", new { controller = "Resource", action = "Render", fileName = "Content/Images/transparent.gif", contentType = "image/gif" });
routes.MapLowerCaseRoute("history-of/{*page}", new { controller = "Wiki", action = "Revisions" });
routes.MapLowerCaseRoute("trackbacks-for/{*page}", new { controller = "Wiki", action = "Pingbacks" });
// Remove .aspx
routes.Add(new RedirectRoute("(?<page>[a-zA-Z0-9/\\-\\._\\+ ]+)\\.aspx", new MvcRouteHandler()) { ReplacePattern = "/$1" });
routes.Add(new RedirectRoute("(?<page>rss)$", new MvcRouteHandler()) { ReplacePattern = "feed", ResponseCode = 302 });
// http://www.cookcomputing.com/blog/archives/xml-rpc-and-asp-net-mvc
routes.MapLowerCaseRoute("wlwmanifest.xml", new { controller = "MetaWeblog", action = "WlwManifest" });
routes.MapLowerCaseRoute("rsd.xml", new { controller = "MetaWeblog", action = "Rsd" });
routes.Add(new Route("{weblog}", null, new RouteValueDictionary(new { weblog = "blogapi" }), new MetaWeblogRouteHandler()));
routes.MapLowerCaseRoute("{*page}", new { controller = "Wiki", action = "Page" });
}
示例5: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.IgnoreRoute("{*robots}", new { robots = @"(.*/)?robots.txt(/.*)?" });
/*
routes.MapLowerCaseRoute(
"ByDeveloper",
"developer/{id}/{page}",
new { controller = "Home", action = "ByDeveloper", page = UrlParameter.Optional },
new { httpMethod = new HttpMethodConstraint(new string[] { "GET" }) }
);
routes.MapLowerCaseRoute(
"Signin",
"signin",
new { controller = "User", action = "Signin" },
new { httpMethod = new HttpMethodConstraint(new string[] { "GET" }) }
);
routes.MapLowerCaseRoute(
"Register",
"register",
new { controller = "User", action = "Register" },
new { httpMethod = new HttpMethodConstraint(new string[] { "GET" }) }
);
routes.MapLowerCaseRoute(
"Profile",
"profile",
new { controller = "User", action = "Profile" },
new { httpMethod = new HttpMethodConstraint(new string[] { "GET" }) }
);
routes.MapLowerCaseRoute(
"Authenticate",
"user/signin",
new { controller = "User", action = "Authenticate" },
new { httpMethod = new HttpMethodConstraint(new string[] { "POST" }) }
);
routes.MapLowerCaseRoute(
"Detail",
"detail/{id}",
new { controller = "Home", action = "Detail" },
new { httpMethod = new HttpMethodConstraint(new string[] { "GET" }) }
);
routes.MapLowerCaseRoute(
"ImportGuide",
"import/guide",
new { controller = "User", action = "ImportGuide" }
);
routes.MapLowerCaseRoute(
"ImportConfirm",
"import/confirm",
new { controller = "User", action = "ConfirmImport" },
new { httpMethod = new HttpMethodConstraint(new string[] { "GET" }) }
);
routes.MapLowerCaseRoute(
"ImportSave",
"import/confirm",
new { controller = "User", action = "SaveImport" },
new { httpMethod = new HttpMethodConstraint(new string[] { "POST" }) }
);
routes.MapLowerCaseRoute(
"ImportInput",
"import",
new { controller = "User", action = "Import" },
new { httpMethod = new HttpMethodConstraint(new string[] { "GET" }) }
);
routes.MapLowerCaseRoute(
"Import",
"import",
new { controller = "User", action = "Import" },
new { httpMethod = new HttpMethodConstraint(new string[] { "POST" }) }
);
MapWishListRoute(routes);
MapOwnedListRoute(routes);
MapKeywordsSearchRoute(routes);
MapIndexSearchRoute(routes);
*/
routes.MapLowerCaseRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}