Advertisement
Guest User

Untitled

a guest
May 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using System.Web.Routing;
  7.  
  8. namespace W1.WebUI
  9. {
  10.     public class RouteConfig
  11.     {
  12.         public static void RegisterRoutes(RouteCollection routes)
  13.         {
  14.             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  15.  
  16.             routes.MapRoute(
  17.                 name: null,
  18.                 url: "Page{page}",
  19.                 defaults: new { Controller = "Product", action = "List" }
  20.                 );
  21.  
  22.             routes.MapRoute(
  23.               name: "Default",
  24.               url: "{controller}/{action}/{id}",
  25.               defaults: new
  26.               {
  27.                   controller = "Product",
  28.                   action = "List",
  29.                   id = UrlParameter.Optional
  30.               }
  31.             );
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement