Denis
Denis

Reputation: 1

Asp.Net MVC2 Deploy

i try to deploy a simple mvc2 application. but it doesnt work. my hosting provider is qualityhosting.de and they support mvc.

i see the homepage "My MVC Application - Welcome to ASP.NET MVC!" but after a click on "about" (for example) i got "The page cannot be found".

Could someone help me please?

Thank you!!

Upvotes: 0

Views: 322

Answers (3)

Yared
Yared

Reputation: 85

You might need to configure the IIS so that it can get the page without any extension i.e. add ".*" as extension, the following site might help http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/ cheers!

Upvotes: 0

veggerby
veggerby

Reputation: 9020

It is most likely because your hosting provider is not configured to handle extension less urls as ASP.NET pages.

For this you need to check if you can configure this with your hosting provider or as an alternative alter your routes so that you include the .aspx (which of course is configured to use ASP.NET) extension in your routes. This however makes "defaults" a little more tricky since you need to have explicit routes for all "levels", i.e.

routes.MapRoute(
    "Default",
    "{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = "" }
);

Becomes

routes.MapRoute(
    "MainActionId",
    "{controller}/{action}/{id}.aspx",
    new { controller = "Home" }
);

routes.MapRoute(
    "MainAction",
    "{controller}/{action}.aspx",
    new { controller = "Home" }
);

routes.MapRoute(
    "Main",
    "{controller}.aspx",
    new { controller = "Home", action = "Index" }
);

Upvotes: 1

Palantir
Palantir

Reputation: 24182

This means that the URL rewriting mechanisms are not working. You should understand what does your provider require to enable them: maybe you need to go to your control panel and enable something?

Upvotes: 1

Related Questions