Home

Castle Stronghold

Castle Project Forum Index Castle Project
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UrlHelper with querystring replacements

 
Post new topic   Reply to topic    Castle Project Forum Index -> MR Usage
View previous topic :: View next topic  
Author Message
Urmo



Joined: 22 Dec 2007
Posts: 10

PostPosted: Wed Dec 26, 2007 2:11 am    Post subject: UrlHelper with querystring replacements Reply with quote

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
View user's profile Send private message
Urmo



Joined: 22 Dec 2007
Posts: 10

PostPosted: Wed Dec 26, 2007 1:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
PSteele



Joined: 29 Sep 2007
Posts: 217
Location: United States

PostPosted: Thu Dec 27, 2007 1:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Castle Project Forum Index -> MR Usage All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group