| View previous topic :: View next topic |
| Author |
Message |
Urmo
Joined: 22 Dec 2007 Posts: 10
|
Posted: Wed Dec 26, 2007 2:11 am Post subject: UrlHelper with querystring replacements |
|
|
I'm stuck again with rather trivial case: i need to form links on page to the controller rendering the page (also to the same action responsible for rendering view) and add query string parameters so that all current querystring parameters are copied to the link and those I specify "override" the parameters with the values i pass.
Basically on page manifested by
/contr/blah.castle?p1=a&p2=b
i want to say
makelink p2 = c
and it becomes
/contr/blah.castle?p1=a&p2=c
I tried to extend UrlHelper but it was rather nonvirtual. Also looking into internals, UrlInfo it uses hasn't got any references to querystring parameters. So what shall I do?
+mc |
|
| Back to top |
|
 |
Urmo
Joined: 22 Dec 2007 Posts: 10
|
Posted: Wed Dec 26, 2007 1:16 pm Post subject: |
|
|
| Nevermind, already got it. However, being not able to inherit and override UrlHelper sucks a bit, I had to duplicate duplicate UrlHelper into my helper class and just change For() method a bit. Make helper methods virtual, please. |
|
| Back to top |
|
 |
PSteele
Joined: 29 Sep 2007 Posts: 217 Location: United States
|
Posted: Thu Dec 27, 2007 1:43 pm Post subject: |
|
|
| A patch (http://support.castleproject.org/browse/MR-379) was recently submitted that made all of the FormHelper methods virtual. If you provided a similar patch for UrlHelper I'm sure it would be appreciated.[/url] |
|
| Back to top |
|
 |
|