Routing issues with MVC Preview 5 and IIS 5.1

Ok, so I spent a couple of hours trying to fix this issue and still had no instructions, keep getting the same 404 error. What happens is the site fills in the Default.aspx page and renders it as it should. But the home page has a clickable image where it is directed to another view page. The image code looks like this:

<a href="<%= Url.Action("SelectPage", "Home") %>" onmouseover="lightup('pic1')" onmouseout="turnoff('pic1') ">
                <img class="imageMain" src="<%= Url.Content("~/Content/Images/image.gif")%>" name="pic1" alt="Image 1" /></a>

      

404 error appears when clicking the button.

My Controller View is configured like this:

public ActionResult SelectPage()
        {
            // Add action logic here
            ViewData["Title"] = "Select an option";
            ViewData["Header"] = "NoHeader";

            return View();
        }

      

in my global file I have a routing setup:

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

      

I have tried wildcard but I had no luck that I tried this tutorial too http://www.asp.net/learn/mvc/tutorial-08-cs.aspx so far with no luck.

I have no idea where to go with this, any help would be greatly appreciated.

+1


source to share


2 answers


I noticed something strange in this tutorial link you posted. You do not need to check the Existing Files check box.



+4


source


Send a message:



http://www.ee99ee.com/blog/2009/02/08/how-to-get-aspnet-mvc-working-under-iis-51-on-windows-xp/

0


source







All Articles