ASP.NET MVC Routing issues - asp.net-mvc

Is there any tools or utilities to help in debugging ASP.NET MVC Routing issues?

Phil Haack, one of the creators of ASP.Net MVC, put together a route debugger. You can get it (with full source code) here.

Glimpse also has a plugin for route debugging.

Related

add an ASP.NET MVC project to an existing ASP.NET Web forms application

How to add an ASP.NET MVC project to an existing ASP.NET Web forms application. How to call MVC project page from existing website.
You can refer this step-by-step guide on how to do that.
Your question is similar to
Is it possible to host an asp.net MVC in the same folder as asp.net web forms app?
We were in the exact same situation as you and it's not as bad as you might think. Thanks to Nuget it's a fairly easy process that you can follow and Dave Paquette describes how to do it in his blog post
And once you've got Mvc up and running all you need to do to go from one to the other is to redirect to Mvc from webforms:
Response.Redirect("~/Controller/Action/")
You can also use the Mvc routing system to generate routes from within webforms as well:
System.Web.Mvc.UrlHelper url = new System.Web.Mvc.UrlHelper(HttpContexxt.Current.Request.requestContext)
Response.Redirect(url.Action("Action", "Controller"))

Debug Attribute Routing in ASP.NET

The AttributeRouting package contains a handler called LogRoutesHandler that "emits the routes in the RouteTable to a browser".
Is there something similar in the new MVC5 attribute routing functionality?
I also miss the routes.axd feature of AttributeRouting in ASP MVC 5. I am using currently using Glimpse to debug routes. It's not quite the same, far from friendly compared to routes.axd, but it helps.

Where is MvcServiceLocator in ASP.NET MVC 3 RC?

I'm trying to incorporate Ninject with my ASP.NET MVC 3 RC application.
From the tutorials I found, I'm supposed to set the ServiceLocator via
MvcServiceLocator.SetCurrent
in the Global.asax file, but I can't seem to find this in ASP.NET MVC 3 RC. Has this been changed to something else?
The design for this feature has changed. The following blog post should answer your questions: http://bradwilson.typepad.com/blog/2010/10/service-location-pt5-idependencyresolver.html

How do you get the area of the current request when using MVC 2 RC?

I was using MVC 1.0 RTM, and the Haack solution for Areas
I just recently moved to MVC2 RC and I'm using single project areas with my controllers in separate assemblies. My problem is that in the MVC 1 solution I ALWAYS had "area" in my RouteData.Values collection, in MVC2 RC it doesn't exist. Do you know how to get this in MVC2 RC?
Thanks in advance!
This is kept in a DataToken for the route. Namely, route.DataTokens["area"]. Look at AreaHelpers.cs in the MVC source for details.
By the way, when you ask a question like this, you should show the code you're using which is not working. It makes it much easier to supply an answer. Right now, I don't know if you've already tried the method above, but are making an error with it, or if you haven't discovered this yet.

ASP.NET MVC - Html.ActionLink<T>(expression)

Is something like Url.Action<TController>(...) or Html.ActionLink<TController>(...) in MvcContrib?
I see the FluentHtml stuff for forms, but I don't see the same concept applied to urls.
This post on CodePlex said it was added, but I don't see it in the source anywhere. Any help would be great.
Edit:
Also, I have read this, but would like to know specifically about MvcContrib.
I think that is part of the Futures: "ASP.NET MVC Futures Assembly"
jeef3 is correct, it is part of the ASP.NET MVC Futures. Mvccontrib has a dependency on it, so if you are using that library you already have it in your project.

Resources