7.5.2 Improving the URLs; Listing 7-24 Adding a New Route to the RouteConfig.cs File
parent
8d40247742
commit
226651bed4
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
|
using System.Web.UI;
|
||||||
|
|
||||||
namespace SportsStore.WebUI
|
namespace SportsStore.WebUI
|
||||||
{
|
{
|
||||||
|
@ -13,6 +14,12 @@ namespace SportsStore.WebUI
|
||||||
{
|
{
|
||||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||||
|
|
||||||
|
routes.MapRoute(
|
||||||
|
name: null,
|
||||||
|
url: "Page{page}",
|
||||||
|
defaults: new { Controller = "Product", action = "List"}
|
||||||
|
);
|
||||||
|
|
||||||
routes.MapRoute(
|
routes.MapRoute(
|
||||||
name: "Default",
|
name: "Default",
|
||||||
url: "{controller}/{action}/{id}",
|
url: "{controller}/{action}/{id}",
|
||||||
|
|
Loading…
Reference in New Issue