<%@ Register Src="~/controls/textLinkAds.ascx" TagName="textLinkAds" TagPrefix="tla"%> SuperWasp - Productivity tips, reviews, tools, software and gadgets.
SuperWasp

SuperWasp

Productivity tips, reviews, tools, software and gadgets.

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

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

» Full Article

  Posted by oVan on Friday, December 21, 2007 | PermaLink | 1 comments
Older articles are stored in the archives (see sidebar).