本文整理汇总了C#中RouteCollection.MapContentRoute方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.MapContentRoute方法的具体用法?C# RouteCollection.MapContentRoute怎么用?C# RouteCollection.MapContentRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteCollection
的用法示例。
在下文中一共展示了RouteCollection.MapContentRoute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenericContentRoute_IsntPushedBackBy_ContentRoute
public void GenericContentRoute_IsntPushedBackBy_ContentRoute()
{
RouteCollection rc = new RouteCollection();
rc.MapContentRoute<Models.RegularPage>("area", MockRepository.GenerateStub<IEngine>());
rc.MapContentRoute("content", MockRepository.GenerateStub<IEngine>());
Assert.That(rc.Count, Is.EqualTo(2));
Assert.That(rc.First(), Is.InstanceOf<ContentRoute<Models.RegularPage>>());
Assert.That(rc.Skip(1).First(), Is.InstanceOf<ContentRoute>());
}
示例2: ContentRoute_IsInsertedBetween_OtherContentRoutes_AndNonContentRoute
public void ContentRoute_IsInsertedBetween_OtherContentRoutes_AndNonContentRoute()
{
RouteCollection rc = new RouteCollection();
rc.MapRoute("mvc", "{controller}/{action}");
rc.MapContentRoute<Models.RegularPage>("area", MockRepository.GenerateStub<IEngine>());
rc.MapContentRoute("content", MockRepository.GenerateStub<IEngine>());
Assert.That(rc.Count, Is.EqualTo(3));
Assert.That(rc.First(), Is.InstanceOf<ContentRoute<Models.RegularPage>>());
Assert.That(rc.Skip(1).First(), Is.InstanceOf<ContentRoute>());
}
示例3: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
L24Manager.Init(routes, typeof(HomeController));
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapContentRoute(
"BlogPost", "Blog/{Year}/{Month}/{Day}/{Name}",
new { controller = "BlogPost", action = "Index" });
routes.MapContentRoute(
"Default", // Route name
"{controller}/{action}", // URL with parameters
new { controller = "Home", action = "Index" } // Parameter defaults
);
}
示例4: ContentRoute_IsAdded
public void ContentRoute_IsAdded()
{
RouteCollection rc = new RouteCollection();
rc.MapContentRoute("content", MockRepository.GenerateStub<IEngine>());
Assert.That(rc.Count, Is.EqualTo(1));
Assert.That(rc.First(), Is.InstanceOf<ContentRoute>());
}
示例5: ContentRoute_IsInsertedBefore_NonContentRoute
public void ContentRoute_IsInsertedBefore_NonContentRoute()
{
RouteCollection rc = new RouteCollection();
rc.MapRoute("mvc", "{controller}/{action}");
rc.MapContentRoute("content", MockRepository.GenerateStub<IEngine>());
Assert.That(rc.Count, Is.EqualTo(2));
Assert.That(rc.First(), Is.InstanceOf<ContentRoute>());
}
示例6: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes, IEngine engine)
{
routes.MapContentRoute("Content", engine);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{*id}", // URL with parameters
new { action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
示例7: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes, IEngine engine)
{
routes.MapContentRoute("Content", engine);
routes.MapRoute("DefaultCss",
"DefaultCss",
new
{
controller = "StartPage",
action = "DefaultCss"
});
}
示例8: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes, IEngine engine)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapContentRoute("Content", engine);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
示例9: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes, IEngine engine)
{
AreaRegistration.RegisterAllAreas(new AreaRegistrationState(engine));
routes.MapContentRoute("Content", engine);
routes.MapRoute("Forum", "Forum",
new { controller = "RedirectToUrl", action = "RedirectToUrl", url = "http://forum.tigersnetball.co.uk" });
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { action = "Index", id = "" }); // Parameter defaults
}
示例10: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes, IEngine engine)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
// This route detects content item paths and executes their controller
routes.MapContentRoute("Content", engine);
// This controller fallbacks to a controller unrelated to N2
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
示例11: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes, IEngine engine)
{
routes.MapContentRoute("Content", engine);
}
示例12: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes, IEngine engine)
{
// The content route routes firndly urls based onthe content structure
routes.MapContentRoute("Content", engine);
}
示例13: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapContentRoute("Content", N2.Context.Current);
}
示例14: RegisterArea
public virtual void RegisterArea(RouteCollection routes, ViewEngineCollection viewEngines, IEngine engine)
{
var route = routes.MapContentRoute<IManagementHomePart>("Management", engine);
var viewLocationFormats = new[] { Url.ResolveTokens("{ManagementUrl}/Myself/Analytics/Views/{1}/{0}.ascx"), Url.ResolveTokens("{ManagementUrl}/Myself/Analytics/Views/Shared/{0}.ascx") };
viewEngines.Insert(0, new PrivateViewEngineDecorator(new WebFormViewEngine { AreaViewLocationFormats = viewLocationFormats, PartialViewLocationFormats = viewLocationFormats }, route));
}
示例15: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("Content/{*pathInfo}");
routes.IgnoreRoute("Scripts/{*pathInfo}");
routes.IgnoreRoute("Styles/{*pathInfo}");
routes.IgnoreRoute("{*sosa}", new { font = @"(.*/)?sosa.(/.*)?" });
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.([iI][cC][oO]|[gG][iI][fF])(/.*)?" });
routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.map/{*pathInfo}");
routes.MapRoute(
"N2Diagnostics",
"Diagnostic/{action}/{id}",
new { controller = "Diagnostic", action = "Index", id = UrlParameter.Optional });
routes.MapRoute(
"RestrictedAdmin",
"Restricted/Admin/{action}/{id}",
new { controller = "Admin", action = "Index", id = UrlParameter.Optional });
routes.MapRoute(
"Sitemap1",
"sitemap.xml",
new { controller = "Sitemap", action = "Index" }
);
routes.MapRoute(
"Sitemap2",
"{siteId}/sitemap.xml",
new { controller = "Sitemap", action = "Index" }
);
routes.MapRoute(
"Sitemap3",
"{siteId}/{cultureCode}/sitemap.xml",
new { controller = "Sitemap", action = "Index" }
);
// n2cms content route
routes.MapContentRoute("CMS", N2.Context.Current, true);
// Image Picker Controller: GetFiles method
routes.MapRoute(
"ImagePickerUploadFiles",
"ImagePicker/UploadFile",
new { controller = "ImagePicker", action = "UploadFile" } // Parameter defaults
);
// Image Picker Controller: GetFiles method
routes.MapRoute(
"ImagePickerGetFiles",
"ImagePicker/GetFiles",
new { controller = "ImagePicker", action = "GetFiles" } // Parameter defaults
);
// Image Picker Controller: Search method
routes.MapRoute(
"ImagePickerImageSearch",
"ImagePicker/Search",
new { controller = "ImagePicker", action = "Search" } // Parameter defaults
);
// Image Picker controller: Index method
routes.MapRoute(
"ImagePickerIndex",
"ImagePicker/{id}",
new { controller = "ImagePicker", action = "Index" }
);
routes.MapRoute(
"CategoryPicker", // Route name
"CategoryPicker/{id}/{categoryId}", // URL with parameters
new { controller = "CategoryPicker", action = "Index", categoryId = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"ProductPickerProductSearch", // Route name
"ProductPicker/SearchProducts/{keywords}/{page}/{pageSize}", // URL with parameters
new { controller = "ProductPicker", action = "SearchProducts", page = UrlParameter.Optional, pageSize = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"ProductPicker", // Route name
"ProductPicker/{id}/{mode}/{selectedItems}", // URL with parameters
new { controller = "ProductPicker", action = "Index", selectedItems = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"ContentPicker", // Route name
"ContentPicker/{id}/{startPageId}", // URL with parameters
new { controller = "ContentPicker", action = "Index" } // Parameter defaults
);
//.........这里部分代码省略.........