I created the asp.net mvc2 project by default in VS2008 and changed the following code: In global.asax.cs I have this code:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"test",
"{browserName}/{browserVersion}/{locale}/{*packageName}",
new { controller = "Test", action = "Index", browserName = "IE", browserVersion = "8", locale = "en-US" , packageName = UrlParameter.Optional }
);
}
Then I added TestController:
public class TestController : Controller
{
public ActionResult Index(
string browserName,
string browserVersion,
string locale,
string packageName)
{
return View();
}
}
And an empty index:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp: Content ID = "Content1" ContentPlaceHolderID = "TitleContent" runat = "server"> Index </ asp: content> <asp: Content ID = "Content2" ContentPlaceHolderID = "MainContent" runat = "server"> <h2> index </ h2> </ asp: content>
For convenience, I added a link to site.master for the URL you specified:
<li><a href="/FF/3/en-US/scripts/packages/6/super.js">Test</a></li>
TestController.
packageName, "scripts/packages/6/super.js"
.
VS2008 MVC2 ?