Sandip's Programming Zen

An attempt to share tech/coding experiences

MVC on IIS6 and older

leave a comment »

Older versions of IIS than IIS7 are not going to recognize MVC urls and there for you need to do a work around solution provided by mvc framework itself.

Need to do two things:

1. Register the .mvc extension in IIS by running following script found under your MVC installation folder:

C:\Program Files\Microsoft ASP.NET\ASP.NET MVC RC\Scripts\iismap.vbs

Note: if you are still using preview version then it might not be there.

2. Change your Global.asax file so that mvc urls can now be used with .mvc extensions:

routes.MapRoute(
"Default",                                              // Route name
"{controller}.mvc/{action}/{id}",                           // URL with parameters
new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
);

Note the that we are adding .mvc after controller name. So your URL may look like http://yourdomain/controller.mvc/viewpage

Hope this helps.

Advertisements

Written by Sandip

February 7, 2009 at 3:21 am

Posted in MVC

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: