- How-to: Viewing current Route in ASP.NET MVC
-
Posted by oVan on Friday, December 21, 2007 | PermaLink | 1 commentsAdvertisement:
For those who are playing with the ASP.NET MVC CTP bits, here's an easy way to check the routing info that was used to arrive at your View. You need to enter this into your Site.Master shared view, put it just below the menu-div.
<div class="debug">
<dl>
<dt>Current routing url:</dt>
<dd><%= ViewContext.RouteData.Route.Url.ToString()%>
</dd>
<dt> Current routing values:</dt>
<dd>
<ol><%= ViewContext.RouteData.Values.ToFormattedList("<li>{0}</li>") %></ol>
</dd>
</dl>
</div>
