2021-09-07 23:40:58 +10:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
using System.Web.Routing;
|
2021-09-08 15:53:41 +10:00
|
|
|
|
using System.Web.UI;
|
2021-09-08 22:08:59 +10:00
|
|
|
|
using Ninject.Infrastructure.Language;
|
2021-09-07 23:40:58 +10:00
|
|
|
|
|
|
|
|
|
namespace SportsStore.WebUI
|
|
|
|
|
{
|
|
|
|
|
public class RouteConfig
|
|
|
|
|
{
|
|
|
|
|
public static void RegisterRoutes(RouteCollection routes)
|
|
|
|
|
{
|
|
|
|
|
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
|
|
|
|
|
2021-09-08 22:08:59 +10:00
|
|
|
|
routes.MapRoute(null,
|
|
|
|
|
"",
|
|
|
|
|
new
|
|
|
|
|
{
|
|
|
|
|
controller = "Product", action = "List",
|
|
|
|
|
category = (string)null, page = 1
|
|
|
|
|
});
|
2021-09-08 15:53:41 +10:00
|
|
|
|
|
2021-09-08 22:08:59 +10:00
|
|
|
|
routes.MapRoute(null,
|
|
|
|
|
"Page{page}",
|
|
|
|
|
new
|
|
|
|
|
{
|
|
|
|
|
controller = "Product",
|
|
|
|
|
action = "List",
|
|
|
|
|
category = (string)null
|
|
|
|
|
},
|
|
|
|
|
new
|
|
|
|
|
{
|
|
|
|
|
page = @"\d+"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
routes.MapRoute(null,
|
|
|
|
|
"{category}",
|
|
|
|
|
new
|
|
|
|
|
{
|
|
|
|
|
controller = "Product",
|
|
|
|
|
action = "List",
|
|
|
|
|
page = 1
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
routes.MapRoute(null,
|
|
|
|
|
"{category}/Page{page}",
|
|
|
|
|
new
|
|
|
|
|
{
|
|
|
|
|
controller = "Product",
|
|
|
|
|
action = "List"
|
|
|
|
|
},
|
|
|
|
|
new
|
|
|
|
|
{
|
|
|
|
|
page = @"\d+"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
routes.MapRoute(null, "{controller}/{action}");
|
2021-09-07 23:40:58 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|