views:

257

answers:

2

I'm using Castle Monorail with jQuery tabbed navigation.

When handling a controller action, I would like to redirect to a view, and control which tab is visible. Therefore, I'd like to have my controller redirecting to a specific anchor in a view, something along the lines of:

RedirectToAction("Edit", "id=1", "#roles"));

Resulting in the url:

http://localhost/MyApp/User/edit.rails?id=1#roles

However, the actual result encodes the # sign to %23

http://localhost/MyApp/User/edit.rails?id=1&%23roles=&

I'm surely missing a basic concept here. What do I need to do to solve this?

A: 

It does not only encode the '#' sign, it simply refer to it as another query string parameter (adds '&' and '=')

I'd advise you to post this question to the users group of Castle Project, and even better - open issue on Castle's issue tracker.

A: 

Not the best solution, but I used RedirectToUrl() and used a static url.

Another solution would be to use the Routing-engine and create the url yourself, and then add the actual hash.

check

RoutingModuleEx.Engine.CreateUrl()

Or something like that.

jishi