本文整理汇总了C#中RouteCollection.MapReportingRoute方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.MapReportingRoute方法的具体用法?C# RouteCollection.MapReportingRoute怎么用?C# RouteCollection.MapReportingRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteCollection
的用法示例。
在下文中一共展示了RouteCollection.MapReportingRoute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapReportingRoute();
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
示例2: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapReportingRoute();
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Admin_elmah",
"Admin/elmah/{type}",
new { action = "Index", controller = "Elmah", type = UrlParameter.Optional }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
示例3: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapReportingRoute();
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "404-PageNotFound",
// This will handle any non-existing urls
url: "{*url}",
// "Shared" is the name of your error controller, and "Error" is the action/page
// that handles all your custom errors
defaults: new { controller = "Shared", action = "Error" }
);
}
示例4: RegisterRoutes
/// <summary>
/// Register MVC routes in the application.
/// </summary>
/// <param name="routes">Existing application route collection.</param>
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapReportingRoute(); // For DoddleReports
routes.MapRoute(
name: MyOpenTrips,
url: "Trip/MyOpenTrips",
defaults: new { controller = "Trip", action = "MyOpenTrips" }
);
routes.MapRoute(
name: MyTrips,
url: "Trip/MyTrips",
defaults: new { controller = "Trip", action = "MyTrips" }
);
routes.MapRoute(
name: CreateTrip,
url: "Trip/Create",
defaults: new { controller = "Trip", action = "Create" }
);
// I'm fairly certain that the DoddleReports installer fiddled web.config
// so that routes that include a file extension get routed through MVC
routes.MapRoute(
name: TrackWithExtension,
url: "Trip/{tripId}/track.{extension}",
defaults: new { controller = "Map", action = "Track" },
constraints: new { tripId = IsPositiveInteger, extension = IsMappingExtension }
);
routes.MapRoute(
name: PositionsWithExtension,
url: "Trip/{tripId}/positions.{extension}",
defaults: new { controller = "Map", action = "Positions" },
constraints: new { tripId = IsPositiveInteger, extension = IsMappingExtension }
);
// For this one, we can set a default extension, preferring compression for what
// is likely to be a large file.
routes.MapRoute(
name: FullTripKml,
url: "Trip/{tripId}/full_trip.{extension}",
defaults: new { controller = "Map", action = "AllData", extension = "kmz" },
constraints: new { tripId = IsPositiveInteger, extension = IsMappingExtension }
);
routes.MapRoute(
name: TripMap,
url: "Trip/{tripId}/Map",
defaults: new { controller = "Map", action = "Index" },
constraints: new { tripId = IsPositiveInteger }
);
routes.MapRoute(
name: Electronics,
url: "Trip/{tripId}/Electronics/{action}",
defaults: new { controller = "Electronics", action = "Index" },
constraints: new { tripId = IsPositiveInteger }
);
routes.MapRoute(
name: Crew,
url: "Trip/{tripId}/Crew/{action}",
defaults: new { controller = "Crew", action = "Index" },
constraints: new { tripId = IsPositiveInteger }
);
routes.MapRoute(
name: Ps1,
url: "Trip/{tripId}/PS-1/{action}",
defaults: new { controller = "Ps1", action = "Index" },
constraints: new { tripId = IsPositiveInteger }
);
routes.MapRoute(
name: TripInfo,
url: "Trip/{tripId}/LL-1/{action}",
defaults: new { controller = "TripInfo", action = "Index" },
constraints: new { tripId = IsPositiveInteger }
);
routes.MapRoute(
name: Gen1Sightings,
url: "Trip/{tripId}/Sightings",
defaults: new { controller = "Gen1", action = "Sightings" },
constraints: new { tripId = IsPositiveInteger }
);
routes.MapRoute(
name: EditGen1Sightings,
url: "Trip/{tripId}/Sightings/Edit",
defaults: new { controller = "Gen1", action = "EditSightings" },
constraints: new { tripId = IsPositiveInteger }
//.........这里部分代码省略.........