How to Rewrite URL using ASP.NET MVC
If you want your URL to looks like /2011/10/11/How-To-Code-Csharp. ASP.NET MVC's URL provide more simple way to rewriting your URL with less coding. This's about how to using ASP.NET MVC to rewriting your URL.
Before we going into how ASP.NET MVC how to work with URL rewriting, if you're interesting in how to use ASP.NET to rewrite your URL. You can look following blog article. How ASP.NET rewriting URL. Basically, there're following way to rewriting URL base on above blog.
- use Request.PathInfo
- use HttpModule
- use HttpModule with IIS7
- use ISAPIRewrite with IIS5, IIS6
Following are step how to rewrite your URL like /2011/10/11/How-To-Code-Csharp. Again,there're so many way we can do this.
Example: If you want your URL like this /2011/10/11/How-To-Code-Csharp.
1. adding Route.Table to Global.asax.cs.
2. How's Controller looks like.
3. That's it!
click following button if you want to download this sample application.