diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-05-19 07:03:06 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-05-19 07:03:06 +0400 |
commit | 7c75a2608c9356ecca60df97a51d9fb729518883 (patch) | |
tree | 131caadc280adaf21d303ae79bf6e96c5c67370a /mcs/class/System.Web.Routing | |
parent | 865ab45e1eef1dde714f760c86e09b94cd05c844 (diff) |
revert. more things broken than fixed
svn path=/trunk/mcs/; revision=134365
Diffstat (limited to 'mcs/class/System.Web.Routing')
-rw-r--r-- | mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog | 14 | ||||
-rw-r--r-- | mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs | 26 |
2 files changed, 4 insertions, 36 deletions
diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog b/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog index d3f4913f27b..6388b5ba715 100644 --- a/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog +++ b/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog @@ -1,17 +1,3 @@ -2009-05-16 Gonzalo Paniagua Javier <gonzalo@novell.com> - - * RouteCollection.cs: when there is no named route, try the current - route before going through the list. The known values (default or - not) for the current route are merged with the values provided when - attempting to match. - Example: - Html.RouteLink ("Text", new { page = 5 }); - - when the current path is /some/path-here and the route is: - - routes.MapRoute("RouteName", "some/{one}-{two}/{page}", - new { controller = "Some", action = "Index", page = 1}); - 2009-05-12 Gonzalo Paniagua Javier <gonzalo@novell.com> * UrlPattern.cs: if the pattern is line {a}/{b} and {b} is substituted diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs b/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs index b584691c7a1..920ed9c76cb 100644 --- a/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs +++ b/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs @@ -150,30 +150,12 @@ namespace System.Web.Routing return null; VirtualPathData vp = null; - // Try the given route, if any, or the current route first... - RouteBase current = null; - RouteValueDictionary dict = null; - bool named_route = (!String.IsNullOrEmpty (name)); - if (named_route) { - current = this [name]; - dict = values; + if (!String.IsNullOrEmpty (name)) { + RouteBase rb = this [name]; + if (rb != null) + vp = rb.GetVirtualPath (requestContext, values); } else { - current = requestContext.RouteData.Route; - dict = new RouteValueDictionary (); - // Grab default values for the current route - foreach (var p in requestContext.RouteData.Values) { - if (!values.ContainsKey (p.Key)) - dict.Add (p.Key, p.Value); - } - foreach (var p in values) - dict.Add (p.Key, p.Value); - } - vp = current.GetVirtualPath (requestContext, dict); - if (!named_route && vp == null) { - //..then try all the other routes in the order they were added foreach (RouteBase rb in this) { - if (rb == current) // Already tried - continue; vp = rb.GetVirtualPath (requestContext, values); if (vp != null) break; |