Exemplo n.º 1
0
            public static void ApplyRoute(AreaRegistrationContext context, ActionResult defaultHandler)
            {
                string prefix = context.AreaName + "_";
                string prefixUrl = context.AreaName + "/";

                context.MapRouteArea(prefix + HalamanC
                    , prefixUrl + "{controller}/{PageIndex}/{PageSize}/{SortField}/{SortOrder}/{id}"
                    , defaultHandler
                    , new { SortOrder = SortDirection.Ascending, id = UrlParameter.Optional }
                    , new { PageIndex = @"\d+", PageSize = @"\d+" }
                );

                context.MapRouteArea(prefix + HalamanB
                    , prefixUrl + "{controller}/{PageIndex}/{PageSize}/{id}"
                    , defaultHandler
                    , new { id = UrlParameter.Optional }
                    , new { PageIndex = @"\d+", PageSize = @"\d+" }
                );

                context.MapRouteArea(prefix + HalamanA
                    , prefixUrl + "{controller}/{PageIndex}/{id}"
                    , defaultHandler
                    , new { id = UrlParameter.Optional }
                    , new { PageIndex = @"\d+" }
                );
            }
Exemplo n.º 2
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRouteArea(
         "MyCoolArea_default",
         "MyCoolArea/{controller}/{action}/{id}",
         MVC.MyCoolArea.Blah.Index().AddRouteValue("id", UrlParameter.Optional)
         );
 }
Exemplo n.º 3
0
 public static Route MapRouteArea(this AreaRegistrationContext context, string name, string url, Task <ActionResult> taskResult, object defaults, object constraints, string[] namespaces)
 {
     return(context.MapRouteArea(name, url, taskResult.Result, defaults, constraints, namespaces));
 }