SuperWasp

SuperWasp

Productivity tips, reviews, tools, software and gadgets.

 
How-to: Viewing current Route in ASP.NET MVC
Advertisement:

ASP.NET-MVC-Active-Route

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.

ASP.NET-MVC-Active-Route-Code

<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>

Labels: , , , ,

  Posted by oVan on Friday, December 21, 2007 | PermaLink | 2 comments
« SuperWasp start page