本文整理汇总了C#中RouteCollection.CreateArea方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.CreateArea方法的具体用法?C# RouteCollection.CreateArea怎么用?C# RouteCollection.CreateArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteCollection
的用法示例。
在下文中一共展示了RouteCollection.CreateArea方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
#region AttachmentRule
routes.CreateArea("administration", "Coders.Web.Controllers.Administration",
routes.MapRoute(AttachmentRuleIndex, "administration/attachments/rules/all/{page}", new { controller = "attachmentrule", action = "index", page = "1" }),
routes.MapRoute(AttachmentRuleHistory, "administration/attachments/rules/history/{sort}/{order}/{page}/{id}", new { controller = "attachmentrule", action = "history", sort = "created", order = "descending", page = "1", id = "" }),
routes.MapRoute(AttachmentRuleUpdate, "administration/attachments/rules/update/{id}", new { controller = "attachmentrule", action = "update", id = "" }),
routes.MapRoute(AttachmentRuleDelete, "administration/attachments/rules/delete/{id}", new { controller = "attachmentrule", action = "delete", id = "" }),
routes.MapRoute(AttachmentRuleCreate, "administration/attachments/rules/create", new { controller = "attachmentrule", action = "create" })
);
#endregion
#region Attachment
routes.CreateArea("administration", "Coders.Web.Controllers.Administration",
routes.MapRoute(AttachmentIndex, "administration/attachments/all/{sort}/{order}/{page}", new { controller = "attachment", action = "index", sort = "created", order = "descending", page = "1" }),
routes.MapRoute(AttachmentHistory, "administration/attachments/history/{sort}/{order}/{page}/{id}", new { controller = "attachment", action = "history", sort = "created", order = "descending", page = "1", id = "" }),
routes.MapRoute(AttachmentUpdate, "administration/attachments/update/{id}", new { controller = "attachment", action = "update", id = "" }),
routes.MapRoute(AttachmentDelete, "administration/attachments/delete/{id}", new { controller = "attachment", action = "delete", id = "" })
);
#endregion
#region Country
routes.CreateArea("administration", "Coders.Web.Controllers.Administration",
routes.MapRoute(CountryIndex, "administration/countries/all/{sort}/{order}/{page}", new { controller = "country", action = "index", sort = "title", order = "ascending", page = "1" }),
routes.MapRoute(CountryHistory, "administration/countries/history/{sort}/{order}/{page}/{id}", new { controller = "country", action = "history", sort = "created", order = "descending", page = "1", id = "" }),
routes.MapRoute(CountryUpdate, "administration/countries/update/{id}", new { controller = "country", action = "update", id = "" }),
routes.MapRoute(CountryDelete, "administration/countries/delete/{id}", new { controller = "country", action = "delete", id = "" }),
routes.MapRoute(CountryCreate, "administration/countries/create", new { controller = "country", action = "create" })
);
#endregion
#region Setting
routes.CreateArea("administration", "Coders.Web.Controllers.Administration",
routes.MapRoute(SettingIndex, "administration/settings/all/{sort}/{order}/{page}", new { controller = "setting", action = "index", sort = "group", order = "ascending", page = "1" }),
routes.MapRoute(SettingHistory, "administration/settings/history/{sort}/{order}/{page}/{id}", new { controller = "setting", action = "history", sort = "created", order = "descending", page = "1", id = "" }),
routes.MapRoute(SettingUpdate, "administration/settings/update/{id}", new { controller = "setting", action = "update", id = "" }),
routes.MapRoute(SettingDelete, "administration/settings/delete/{id}", new { controller = "setting", action = "delete", id = "" }),
routes.MapRoute(SettingCreate, "administration/settings/create", new { controller = "setting", action = "create" })
);
#endregion
#region TimeZone
routes.CreateArea("administration", "Coders.Web.Controllers.Administration",
routes.MapRoute(TimeZoneIndex, "administration/timezones/all/{sort}/{order}/{page}", new { controller = "timezone", action = "index", sort = "offset", order = "ascending", page = "1" }),
routes.MapRoute(TimeZoneHistory, "administration/timezones/history/{sort}/{order}/{page}/{id}", new { controller = "timezone", action = "history", sort = "created", order = "descending", page = "1", id = "" }),
routes.MapRoute(TimeZoneUpdate, "administration/timezones/update/{id}", new { controller = "timezone", action = "update", id = "" }),
routes.MapRoute(TimeZoneDelete, "administration/timezones/delete/{id}", new { controller = "timezone", action = "delete", id = "" }),
routes.MapRoute(TimeZoneCreate, "administration/timezones/create", new { controller = "timezone", action = "create" })
);
#endregion
#region Home
routes.CreateArea("administration", "Coders.Web.Controllers.Administration",
routes.MapRoute(HomeIndex, "administration", new { controller = "home", action = "index" })
);
#endregion
}
示例2: RegisterRoutesTo
public static void RegisterRoutesTo(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
// The areas below must be registered from greater subareas to fewer;
// i.e., the root area should be the last area registered
// Example illustrative routes with a nested area - note that the order of registration is important
//routes.CreateArea("Organization/Department", "DI.Colef.Sia.Web.Controllers.Organization.Department",
// routes.MapRoute(null, "Organization/Department/{controller}/{action}", new { action = "Index" }),
// routes.MapRoute(null, "Organization/Department/{controller}/{action}/{id}")
//);
routes.MapRoute(null, "Login", new { controller = "Session", action = "Index" });
routes.MapRoute(null, "Logout", new { controller = "Session", action = "Destroy" });
routes.CreateArea("Productos", "DecisionesInteligentes.Colef.Sia.Web.Controllers.Productos",
routes.MapRoute("Productos", "Productos/{controller}/{id}/{action}", null, new {id = @"\d{1,6}"}),
routes.MapRoute(null, "Productos/{controller}/{action}", new {action = "Index"})
);
routes.CreateArea("Catalogos", "DecisionesInteligentes.Colef.Sia.Web.Controllers.Catalogos",
routes.MapRoute(null, "Catalogos/{controller}/{id}/{action}", null, new {id = @"\d{1,6}"}),
routes.MapRoute(null, "Catalogos/{controller}/{action}", new {action = "Index"})
);
// Routing config for the root area
routes.CreateArea("Root", "DecisionesInteligentes.Colef.Sia.Web.Controllers",
routes.MapRoute(null, "{controller}/{id}/{action}/{tipoProducto}", new { action = "Index", id = "", tipoProducto = "" }, new { id = @"\d{1,6}", tipoproducto = @"\d{1,6}" }),
routes.MapRoute(null, "{controller}/{id}/{action}", null, new {id = @"\d{1,6}"}),
routes.MapRoute("Default", "{controller}/{action}", new {controller = "Home", action = "Index"})
);
routes.MapRoute(
null,
"{controller}/{id}/{action}/{tipoproducto}",
new { action = "Index", id = "", tipoproducto = "" }, new { id = @"\d{1,6}", tipoproducto = @"\d{1,6}" }
);
routes.MapRoute(
null,
"{controller}/{id}/{action}",
new { action = "Index", id = "" }, new { id = @"\d{1,6}" }
);
routes.MapRoute(
null,
"{controller}/{action}",
new {action = "Index"}
);
}
示例3: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
#region Host Search
routes.CreateArea("administration/users", "Coders.Web.Controllers.Users.Administration",
routes.MapRoute(HostSearchIndex, "administration/users/hosts/search/results/{id}/{page}", new { controller = "hostsearch", action = "index", id = "", page = "1" }),
routes.MapRoute(HostSearchDelete, "administration/users/hosts/search/delete/{id}", new { controller = "hostsearch", action = "delete", id = "" }),
routes.MapRoute(HostSearchCreate, "administration/users/hosts/search/create", new { controller = "hostsearch", action = "create" })
);
#endregion
#region Search
routes.CreateArea("administration/users", "Coders.Web.Controllers.Users.Administration",
routes.MapRoute(SearchIndex, "administration/users/search/results/{id}/{page}", new { controller = "search", action = "index", id = "", page = "1" }),
routes.MapRoute(SearchDelete, "administration/users/search/delete/{id}", new { controller = "search", action = "delete", id = "" }),
routes.MapRoute(SearchCreate, "administration/users/search/create", new { controller = "search", action = "create" })
);
#endregion
#region Ban
routes.CreateArea("administration/users", "Coders.Web.Controllers.Users.Administration",
routes.MapRoute(BanIndex, "administration/users/bans/all/{sort}/{order}/{page}", new { controller = "ban", action = "index", sort = "created", order = "descending", page = "1" }),
routes.MapRoute(BanUpdate, "administration/users/bans/update/{id}", new { controller = "ban", action = "update", id = "" }),
routes.MapRoute(BanDelete, "administration/users/bans/delete/{id}", new { controller = "ban", action = "delete", id = "" }),
routes.MapRoute(BanCreate, "administration/users/bans/create", new { controller = "ban", action = "create" })
);
#endregion
#region Role
routes.CreateArea("administration/users", "Coders.Web.Controllers.Users.Administration",
routes.MapRoute(RoleIndex, "administration/users/roles/all", new { controller = "role", action = "index" }),
routes.MapRoute(RoleHistory, "administration/users/roles/history/{sort}/{order}/{page}/{id}", new { controller = "role", action = "history", sort = "created", order = "descending", page = "1", id = "" }),
routes.MapRoute(RoleUpdate, "administration/users/roles/update/{id}", new { controller = "role", action = "update", id = "" }),
routes.MapRoute(RoleDelete, "administration/users/roles/delete/{id}", new { controller = "role", action = "delete", id = "" }),
routes.MapRoute(RoleCreate, "administration/users/roles/create", new { controller = "role", action = "create" }),
routes.MapRoute(RolePrivilege, "administration/users/roles/privilege/{id}", new { controller = "role", action = "privilege", id = "" })
);
#endregion
#region User
routes.CreateArea("administration/users", "Coders.Web.Controllers.Users.Administration",
routes.MapRoute(HomeIndex, "administration/users/all/{sort}/{order}/{page}", new { controller = "home", action = "index", sort = "name", order = "descending", page = "1" }),
routes.MapRoute(HomeHistory, "administration/users/history/{sort}/{order}/{page}/{id}", new { controller = "home", action = "history", sort = "created", order = "descending", page = "1", id = "" }),
routes.MapRoute(HomeUpdate, "administration/users/update/{id}", new { controller = "home", action = "update", id = "" }),
routes.MapRoute(HomeDelete, "administration/users/delete/{id}", new { controller = "home", action = "delete", id = "" }),
routes.MapRoute(HomeReset, "administration/users/reset/{id}", new { controller = "home", action = "reset", id = "" }),
routes.MapRoute(HomeCreate, "administration/users/create", new { controller = "home", action = "create" })
);
#endregion
}
示例4: RegisterRoutesTo
public static void RegisterRoutesTo(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.CreateArea("Root", "Infoboard.Web",
routes.MapRoute(null, "{controller}/{action}", new { controller = "Home", action = "Index" }),
routes.MapRoute(null, "{controller}/{action}/{id}"));
}
示例5: RegisterRoutes
/// <summary>
/// Registers the routes.
/// </summary>
/// <param name="routes">The routes.</param>
public static void RegisterRoutes(RouteCollection routes)
{
#region Avatar
routes.CreateArea("users", "Coders.Web.Controllers.Users",
routes.MapRoute(AvatarIndex, "account/avatars/all/{page}", new { controller = "avatar", action = "index", page = "1" }),
routes.MapRoute(AvatarSelect, "account/avatars/assign/{id}", new { controller = "avatar", action = "assign", id = "" }),
routes.MapRoute(AvatarDelete, "account/avatars/delete/{id}", new { controller = "avatar", action = "delete", id = "" }),
routes.MapRoute(AvatarCreate, "account/avatars/create", new { controller = "avatar", action = "create" })
);
#endregion
#region Preference
routes.CreateArea("users", "Coders.Web.Controllers.Users",
routes.MapRoute(PreferenceUpdate, "account/preference/update", new { controller = "preference", action = "update" })
);
#endregion
#region Search
routes.CreateArea("users", "Coders.Web.Controllers.Users",
routes.MapRoute(SearchIndex, "users/search/results/{id}/{page}", new { controller = "search", action = "index", id = "", page = "1" }),
routes.MapRoute(SearchCreate, "users/search/create", new { controller = "search", action = "create" })
);
#endregion
#region Auth
routes.CreateArea("users", "Coders.Web.Controllers.Users",
routes.MapRoute(AuthLogOn, "account/logon", new { controller = "auth", action = "logon" }),
routes.MapRoute(AuthLogOff, "account/logoff", new { controller = "auth", action = "logoff" }),
routes.MapRoute(AuthReset, "account/password/reset", new { controller = "auth", action = "reset" }),
routes.MapRoute(AuthUpdate, "account/password/update", new { controller = "auth", action = "update" })
);
#endregion
#region User
routes.CreateArea("users", "Coders.Web.Controllers.Users",
routes.MapRoute(Create, "account/create", new { controller = "home", action = "create" }),
routes.MapRoute(Update, "account/update", new { controller = "home", action = "update" }),
routes.MapRoute(Index, "users/all/{sort}/{order}/{page}", new { controller = "home", action = "index", sort = "name", order = "ascending", page = "1" }),
routes.MapRoute(Detail, "users/{slug}/{id}", new { controller = "home", action = "detail", id = "", slug = "" })
);
#endregion
}
示例6: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*allaspx}", new { allaspx = @".*\.aspx(/.*)?" });
routes.IgnoreRoute("{*allashx}", new { allashx = @".*\.ashx(/.*)?" });
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.CreateArea("manager", "Cuyahoga.Web.Manager.Controllers",
routes.MapRoute(null, "manager/Pages/Design/{id}/Section/{sectionId}", new { action = "Design", controller = "Pages" }),
routes.MapRoute(null, "manager/{controller}/{action}/{id}", new { action = "Index", controller = "Dashboard", id = "" }),
routes.MapRoute(null, "Login", new { action = "Index", controller = "Login" }) // Also put the login functionality in the manager area.
);
routes.CreateArea("modules/shared", "Cuyahoga.Web.Modules.Shared.Controllers",
routes.MapRoute(null, "modules/shared/{controller}/{action}/{id}", new { action = "Index", id = "" })
);
// Routing config for the root area (not currently used)
//routes.CreateArea("root", "Cuyahoga.Web.Controllers",
// routes.MapRoute(null, "{controller}/{action}", new { controller = "Home", action = "Index" })
//);
}
示例7: RegisterRoutesTo
public static void RegisterRoutesTo(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
// The areas below must be registered from greater subareas to fewer;
// i.e., the root area should be the last area registered
// Example illustrative route with a nested area
//routes.CreateArea("Organization/Department", "Northwind.Web.Controllers.Organization.Department",
// routes.MapRoute(null, "Organization/Department/{controller}/{action}", new { action = "Index" })
//);
routes.CreateArea("Organization", "Northwind.Web.Controllers.Organization",
routes.MapRoute(null, "Organization/{controller}/{action}", new { action = "Index" }),
routes.MapRoute(null, "Organization/{controller}/{action}/{id}")
);
// Routing config for the root area
routes.CreateArea("Root", "Northwind.Web.Controllers",
routes.MapRoute(null, "{controller}/{action}", new { controller = "Home", action = "Index" })
);
}
示例8: RegisterRoutes
public void RegisterRoutes(RouteCollection routes)
{
routes.CreateArea("Modules/Articles", "Cuyahoga.Modules.Articles.Controllers",
routes.MapRoute("ArticlesRoute", "Modules/Articles/{controller}/{action}/{id}", new { action = "Index", controller = "", id = "" })
);
}
示例9: RegisterProduct
/// <summary>
/// 注册产品和物料管理路径
/// </summary>
/// <param name="routes"></param>
private static void RegisterProduct(RouteCollection routes)
{
routes.CreateArea("Product", "Git.Storage.Web.Areas.Product.Controllers", routes.MapRoute("Product_Default", "{controller}/{action}", new { controller = "Home", action = "Index" }));
}
示例10: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.CreateArea("Root", "Git.Storage.Web.Controllers", routes.MapRoute("Root_Default", "{controller}/{action}", new { controller = "Home", action = "Index" }));
}