本文整理汇总了C#中System.Web.Mvc.AreaRegistrationContext.MapEmbeddedResource方法的典型用法代码示例。如果您正苦于以下问题:C# AreaRegistrationContext.MapEmbeddedResource方法的具体用法?C# AreaRegistrationContext.MapEmbeddedResource怎么用?C# AreaRegistrationContext.MapEmbeddedResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.AreaRegistrationContext
的用法示例。
在下文中一共展示了AreaRegistrationContext.MapEmbeddedResource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterArea
public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
{
// Map embedded resources.
// NB: Must come before main Area mapping.
context.MapEmbeddedResource(AreaName, "ResourceContentRoute", AreaName + "/Content/{resourceName}");
context.MapEmbeddedResource(AreaName, "ResourceImageRoute", AreaName + "/Images/{resourceName}", resourcePath: "Content/Images");
context.MapEmbeddedResource(AreaName, "ResourceCssRoute", AreaName + "/Css/{resourceName}", resourcePath: "Content/Css");
context.MapEmbeddedResource(AreaName, "TestHarnessImagesRoute", AreaName + "/TestHarness/Images/{resourceName}", resourcePath: "Content/Images/TestHarness");
// Script folders:
context.MapEmbeddedResource(AreaName, "ResourceScriptsRoute", AreaName + "/Scripts/{resourceName}", resourcePath: "Content/Scripts");
context.MapEmbeddedResource(AreaName, "ResourceScriptsRouteJQuery", AreaName + "/Scripts/JQuery/{resourceName}", resourcePath: "Content/Scripts/JQuery");
// Map the area.
context.MapRoute(
AreaName + "TestHarness", // Route name
AreaName, // URL
new { controller = TestHarnessController.Name, action = TestHarnessController.ActionPage });
// Default mapping.
context.MapRoute(
AreaName,
string.Format("{0}/{{controller}}/{{action}}", AreaName));
// Finish up.
base.RegisterAreaEmbeddedResources();
}