Thanks John, Unfortunately that still doesn't seem to be working for me - even after switching to using a named route I'm seeing the same behavior as before.
Also, the existing documentation ( http://stw.castleproject.org/MonoRail.Routing.ashx#Generating_URLs_6) seems to indicate that you don't need to use a named route to accomplish this - is the documentation wrong? Cheers, Symon. Symon Rottem http://blog.symbiotic-development.com On Thu, Oct 21, 2010 at 8:36 AM, John Simons <[email protected]>wrote: > Hi Symon, > > When you register your routing give them a name and then you can > reference it in the urlhelper, eg: > RoutingModuleEx.Engine.Add(new PatternRoute("ViewProductRoute", "/ > <controller>/<id>/view.ashx") > .DefaultForAction().Is("view") > .Restrict("id").ValidInteger > ); > > $Url.Link("MyUser", "%{routename='ViewProductRoute', params={id=10}}") > > Hope this helps. > > Cheers > John > > > On Oct 19, 10:58 pm, Symon Rottem <[email protected]> wrote: > > I'm a little stumped at the moment; I'm using the new routing engine for > the > > first time and I'm having trouble getting the UrlHelper to play nice. > > > > Traditionally I've been passing the parameter "querystring='key=value'" > but > > this doesn't seem to work with the routing engine when generating URLs. > The > > routing engine docs instead indicate that the format "params={key=value}" > > but this seems to result in nothing appearing at all. > > > > My route is registered using: > > > > RoutingModuleEx.Engine.Add(new > PatternRoute("/<controller>/<id>/view.ashx") > > .DefaultForAction().Is("view") > > .Restrict("id").ValidInteger > > ); > > > > I try to generate links for this using... > > > > $Url.Link(MyUser, "%{controller='user', action='view', params={id=10}}") > > > > ...and this ends up generating the URL "/user/view.ashx" - no id > parameter > > anywhere. If, on the other hand, I use the querystring like so: > > > > $Url.Link(MyUser, "%{controller='user', action='view', > > querystring='id=10'}") > > > > ...I end up with "/user/view.ashx?id=10". > > > > What am I doing wrong? > > > > Cheers, > > > > Symon. > > > > Symon Rottemhttp://blog.symbiotic-development.com > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Users" group. > To post to this group, send email to [email protected] > . > To unsubscribe from this group, send email to > [email protected]<castle-project-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
