ASP.NET MVC Preview 2

Discussion in 'ASP.NET / ASP.NET Core' started by ksachdeva, Mar 22, 2008.

  1. Hi,

    I am trying to run the most simplest of MVC application (basically the one generated by template) and running in to 404 issues.

    I even added .mvc extension in front of controller name as recommended [please see the snippet below]

     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Are you on IIS 6 or IIS 7?


    If you are on IIS6, please open a support ticket and request .mvc to be mapped to ASP.NET


    If you are using IIS7, you can use the IIS Manager (MS download) to add the scriptmap yourself.



    Please let us know if preview 2 will work on the server once the mapping is installed.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Im on IIS 7, and I tried uploading the sample proj, worked fine for me (I didn't add .mvc)
     
  4. Bruce

    Bruce DiscountASP.NET Staff

  5. I'm havingproblems with Preview 3. Does anyone have a clue about how to get a MVC Hello World application to work?
    I have no problems running the app on my local host, but that didn't happen on DiscountASP, and I did put all Preview assembly references in my own folder on the host machine.
     
  6. Thanks toLiam Westley for pointing me in the right direction. http://community.discountasp.net/default.aspx?m=22822&f=33&p=1

    Make sureyour global.asax.cs includes:

    public static void RegisterRoutes(RouteCollection routes)
    {
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    routes.MapRoute(
    "Default", // Route name
    "{controller}.mvc.aspx/{action}/{id}", // URL with parameters
    new { controller = "Home", action = "Index", id = "" } // Parameter defaults
    );
    }

    andyour Default.aspx.cs has:

    public void Page_Load(object sender, System.EventArgs e)
    {
    Response.Redirect("~/Home.mvc.aspx");
    }
     

Share This Page