locked
Enabling Dynamic Data in MVC (P5) RRS feed

  • Question

  • User665852022 posted
    Hey guys I'm trying to enable dynamic data in my existing mvc app. I can run the mvcDynamicData sample app succesfully, unfortunately when I run my own app I get a 404. I've copied the entire DynamicData directory from the sample app, and added a reference to System.Web.DynamicData I'm guessing my problem lies in the routing. Here's my registration of routes: private static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); MetaModel model = new MetaModel(); model.RegisterContext(typeof(OosterkampEntities), new ContextConfiguration() { ScaffoldAllTables = true }); routes.Add(new DynamicDataRoute("DD/{table}/{action}.aspx") { Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }), Model = model }); routes.MapRoute( "Default.mvc", // Route name "{controller}.mvc/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" }, // Parameter defaults new { controller = @"[^\.]*" } // Parameter constraints - Do not allow dots in the controller name ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" }, // Parameter defaults new { controller = @"[^\.]*" } // Parameter constraints - Do not allow dots in the controller name ); } It's worth mentioning that the stuff will be deployed on IIS6, but it won't work on IIS7 either :s I hope anyone can point me into the right direction... tnx!
    Monday, October 13, 2008 7:12 PM

Answers

  • User665852022 posted
    hmm. I found the issue. I didn't copy the Site.master from the DynamicData app, because I already had one. I thought it would only be relevant for the layout, but the views searched for this Site.master and couldnt find it, thus throwing a 404 :s
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 14, 2008 4:11 AM

All replies

  • User-797310475 posted

    Did you modify web.config to register the appropriate routing modules and handlers?

    Monday, October 13, 2008 7:51 PM
  • User665852022 posted
    hmm. I found the issue. I didn't copy the Site.master from the DynamicData app, because I already had one. I thought it would only be relevant for the layout, but the views searched for this Site.master and couldnt find it, thus throwing a 404 :s
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 14, 2008 4:11 AM