Created
          January 23, 2011 02:26 
        
      - 
      
- 
        Save azcoov/791747 to your computer and use it in GitHub Desktop. 
    routes for my blog
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | routes.MapRoute( | |
| "BlogPost", | |
| "Entries", | |
| new { controller = "Blog", action = "BlogPost"} | |
| ); // outputs: mysite.com/Entries?id=0 | |
| routes.MapRoute( | |
| "BlogPost1", | |
| "Entries/{id}", | |
| new { controller = "Blog", action = "BlogPost" } | |
| ); // outputs: mysite.com/Entries/0 | |
| routes.MapRoute( | |
| "BlogPost2", | |
| "Entries/{year}/{month}/{day}/{title}", | |
| new { controller = "Blog", action = "BlogPost" } | |
| ); // outputs: mysite.com/Entries/2010/01/14/Hello World | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment