Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. <rule name="Old Objects 2" stopProcessing="true">
  2. <match url="^transportbilar/(nya|begagnade|miljobilar)/(.*)$" ignoreCase="true"/>
  3. <action type="Rewrite" url="/transportbilar/{R:2}"/>
  4. </rule>
  5.  
  6. url.Action("Slideshow", "Object", new { id = objectId });
  7.  
  8. transportbilar/handlare/{id}/{criteria}
  9. transportbilar/handlare
  10. transportbilar
  11. transportbilar/sokresultat/{criteria}
  12. transportbilar/{brand}/{id}/{criteria}
  13. {controller}/{action}/{id}
  14.  
  15. <%= Request.Path %>
  16. <%= Request.RawUrl %>
  17. <%= Request.ServerVariables["HTTP_URL"] %>
  18.  
  19. routes.MapRoute(
  20. "OldObject2",
  21. "transportbilar/{mycondition}/{make}/{id}",
  22. new { controller = "Object", action = "Slideshow" },
  23. new
  24. {
  25. mycondition = "nya|begagnade|miljobila"
  26. }
  27. );
  28.  
  29. routes.MapRoute(
  30. "NewRoute",
  31. "transportbilar/{make}/{id}",
  32. new { controller = "Home", action = "Test" }
  33. );
  34. routes.MapRoute(
  35. "OldRoute",
  36. "transportbilar/{mycondition}/{make}/{id}",
  37. new { controller = "Home", action = "Test" },
  38. new
  39. {
  40. mycondition = "nya|begagnade|miljobila"
  41. }
  42. );
  43.  
  44. <p>@Html.ActionLink("link", "Test", new { make = "testmake4", id = 5})</p>
  45.  
  46. public static string UrlAction(string actionName) {
  47. return String.Format("/{0}", actionName);
  48. }
  49.  
  50. public static string UrlAction(string actionName, string controllerName) {
  51. return String.Format("/{0}/{1}", controllerName, actionName);
  52. }
  53.  
  54. public static string UrlAction(string actionName, string controllerName, RouteValueDictionary routeValues) {
  55. string url = String.Format("/{0}/{1}", controllerName, actionName);
  56.  
  57. var parameters = routeValues.Select(s => string.Format("{0}={1}", s.Key, s.Value))
  58. .Aggregate((current, next) => string.Format("{0}&{1}", current, next));
  59.  
  60. return url+"?"+parameters;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement