Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <rule name="Old Objects 2" stopProcessing="true">
- <match url="^transportbilar/(nya|begagnade|miljobilar)/(.*)$" ignoreCase="true"/>
- <action type="Rewrite" url="/transportbilar/{R:2}"/>
- </rule>
- url.Action("Slideshow", "Object", new { id = objectId });
- transportbilar/handlare/{id}/{criteria}
- transportbilar/handlare
- transportbilar
- transportbilar/sokresultat/{criteria}
- transportbilar/{brand}/{id}/{criteria}
- {controller}/{action}/{id}
- <%= Request.Path %>
- <%= Request.RawUrl %>
- <%= Request.ServerVariables["HTTP_URL"] %>
- routes.MapRoute(
- "OldObject2",
- "transportbilar/{mycondition}/{make}/{id}",
- new { controller = "Object", action = "Slideshow" },
- new
- {
- mycondition = "nya|begagnade|miljobila"
- }
- );
- routes.MapRoute(
- "NewRoute",
- "transportbilar/{make}/{id}",
- new { controller = "Home", action = "Test" }
- );
- routes.MapRoute(
- "OldRoute",
- "transportbilar/{mycondition}/{make}/{id}",
- new { controller = "Home", action = "Test" },
- new
- {
- mycondition = "nya|begagnade|miljobila"
- }
- );
- <p>@Html.ActionLink("link", "Test", new { make = "testmake4", id = 5})</p>
- public static string UrlAction(string actionName) {
- return String.Format("/{0}", actionName);
- }
- public static string UrlAction(string actionName, string controllerName) {
- return String.Format("/{0}/{1}", controllerName, actionName);
- }
- public static string UrlAction(string actionName, string controllerName, RouteValueDictionary routeValues) {
- string url = String.Format("/{0}/{1}", controllerName, actionName);
- var parameters = routeValues.Select(s => string.Format("{0}={1}", s.Key, s.Value))
- .Aggregate((current, next) => string.Format("{0}&{1}", current, next));
- return url+"?"+parameters;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement