Sign in | Join
Last post 01-25-2008 10:49 PM by jamesgeurts. 10 replies.
Sort Posts: Oldest to newest Newest to oldest
Hi all,
I am trying to put a build of a web app. using ASP.NET MVC on a Windows 2003 test server. Up to now I have been running with Cassini.I simply cannot get it to work.I have installed .NET 3.5 and installed the CTP meaning that the .dlls are in the GAC.I can hit the default page but when I try and type in any restful URLs that should route to controllers, I get HTTP 404.I have no idea what is going on.Can anyone help me out or experienced anything similar?CheersPaul
Ok,
What do your other routing rules look like?
Just noticed in your code: <form id="main" action='/ncontinuity2.web/LogIn.mvc.aspx/LogIn' method="post">
I don't think that the .aspx should be there. If you rewrite your form like this:
<form id="main" action='/ncontinuity2.web/LogIn.mvc/LogIn' method="post">
does it work?
Hi,
});Next I had to change my authentication element to the following:<authentication mode="Forms"> <forms name="dncontinuity2user" loginUrl="/LogIn.mvc.aspx" defaultUrl="/BCM.mvc.aspx" protection="All" timeout="30" path="/"/>
</authorization>
</location>I don’t like having to add a new location element for each controller. Previously I denied all users and then just allowed the various controllers that could grant public access.I am left with one problem. The root URL ‘/’ will not default to the HomeController. I have the following addition to the RouteTable:I have tried many things. In desperation I thinking of redirecting in the BeginRequest event in Global.asax.Any ideas why Default route is not working.
You should have this route at the bottom of the list:
RouteTable.Routes.Add(new Route { Url = "Default.aspx", Defaults = new { controller = "Home", action = "Index", id = (string)null }, RouteHandler = typeof(MvcRouteHandler) });
Trust me when I say you dont need any of the above to get your mvc app working on Windows 2003.
Have a look at my post here for hints about setting up forms auth in ASP.NET. And here for how to get rid of the 'Default.aspx' route.
Well that being the case how do you handle extensionless Urls?The only way in IIS6 is to use wild card application mapping which is not a scalable answer.
I don't think this will work in IIS6 either:
RouteTable.Routes.Add(new Route { Url = "", Defaults = new { controller = "Home", action = "Index", id = (string)null }, RouteHandler = typeof(MvcRouteHandler) } );
dagda2: You need to specifiy Default.aspx
In your route, and IIS6 will default to mapping a folder only URL to the first of a list of default files which includes Default.aspx.
fyi, I setup a step by step "tutorial" for how to setup asp.net mvc on iis6 with pretty urls. It uses the .mvc extension mapping and isapi_rewrite, so it performs well and has nice urls.