Quantcast
Channel: Sampath Lokuge Tech Blog
Viewing all articles
Browse latest Browse all 107

How to Use Asp.Net MVC Routing Debugger Visualizer ?

$
0
0
What is MVC Routing Debugger Visualizer ?
  • It's an Extension for Visual Studio 2010
  • It Displays the Matched Route Data and Data Tokens of All Defined Routes in your web application
  • It's a Free Product

What is the Basic Requirement Needed for Run MVC Routing Debugger ?
  • Microsoft Visual Studio 2010Any EditionExceptExpress Editions 

How to Install MVC Routing Debugger ?

Step 1. Open Visual Studio 2010

Step 2. Click  Tools  ---> Extension Manager



Step 3. Click "Online Gallery" Button



Step 4. Type "ASP.NET MVC Routing" inside the Search box



Step 5. Click "Download" Button



Step 6. Click "Install" Button



Step 7. Click "Restart Now" Button for Restart Visual Studio 2010



That's It.You're Done.


How to Use MVC Routing Debugger ?

Step 1.Run Visual Studio 2010

Step 2.Open Your Asp.Net MVC Project

Step 3. Go to Your Action Method Which You Want to Find Route Details

Step 4.Set a Brake Point on it (Debug your Action Method)


Step 5.Run Your Application

Step 6. When It Hits Your Brake Point , Open the "Watch Window"



Step 7. Add a New Watch Row for "System.Web.Routing.RouteTable.Routes"



Step 8. Click on the "Magnifying Glass Icon" at the Right Side of the Value field on the
            New Watch Row



Step 9. The "MVC Routing Debugger Visualizer" should be Opened


  • You can see the Current URL in the Request Url Field
  • Grid of Currently-Defined Routes below that
  • Routes that Match the URL are Highlighted
  • Route Data and Data Tokens Grids are also Showing on the Right side

This is my Global.asax.cs

publicstaticvoid RegisterRoutes(RouteCollectionroutes)
 {
  routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

  routes.MapRoute(
   "Default", // Route name
   "{controller}/{action}/{id}", // URL with parameters
   new { controller ="Home",action ="Index",id =UrlParameter.Optional }//defaults
                 );
  }

How to Change the Value in Request Url ?
  • Type the Request Url (e.g. ~/ShoppingCart)
  • Click "Match Routes" Buttons




That's It.You're Done.


Do You need to Know More Details ?
  • MVC Routing Debugger Visualizer Home

Conclusion
  • It's a very simple Tool for Use and Configure
  • It's running only on Debugger mode
  • When we're having route related issues, this is a tool for debug those issues
  • So Try This and Enjoy it

I hope this helps to You.Comments and feedback greatly appreciated.

Happy Coding


Tools for Visual Studio 2010


Viewing all articles
Browse latest Browse all 107

Trending Articles