Posts Tagged: MVC

REST service 404 problem in Microsoft MVC 3

To be able to catch the HTTP DELETE on a route you need to add <remove name=”UrlRoutingModule-4.0″ /> <add name=”UrlRoutingModule-4.0″ type=”System.Web.Routing.UrlRoutingModule” preCondition=”” /> <!– any other modules you want to run in MVC e.g. FormsAuthentication, Roles etc. –> under system.webServer in Web.config

ASP.Net MVC3 Routing with Guid

Spent a couple of hours trying to get routing with a Guid to work for MVC3 without luck. Here is the solution: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”); routes.MapRoute(“FooRouteName”, “Controller/Action/{guidParam}”, new { controller = “PremiumManager”, action = “ActionViewImage” }, new { guidParam = @”^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$” } ); routes.MapRoute( “Default”, // Route name “{controller}/{action}/{id}”, // URL… Read more »