Another MVC problem with recent beta (10/15/2008)

Discussion in 'ASP.NET / ASP.NET Core' started by statcomp, Dec 3, 2008.

  1. I copied all mvc-related dlls (system.web.mvc, system.web.abstraction, system.web.routing) to my bin to make my mvc application work. Andmy websitesuccessfully displayed its homepage. But when user clicks any other link (actionlink) on it, the system displays "page cannot be found" error. I have tried several things by repeating publshing in vain.[​IMG] I will appreciateANY clue. Thanks in advance.
     
  2. After reading and trying the blogs about running mvc on iis 6 for last 4 hours, I found following solution to have this method in global.asax.cs

    public static void RegisterRoutes(RouteCollection routes)
    {
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    routes.MapRoute(
    "Default.aspx", // Route name
    "{controller}.aspx/{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
    );
    }

    As you might realize, second maproute is for running the app in local machine while first one for running it in discountasp shared machine. For some reason, it will not work if you change the order butI am not sure why. Anyway, I hope you don't waste your time to deploy mvc on discountasp like I did.
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    Glad you resolved the problem and thanks for posting resolution.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. An easier solution to the problem is to change your App pool pipeline mode to "Integrated". It's in your control panel under IIS Tools -> ASP.Net Version

    Rob Cannon
     

Share This Page