Yes, I've put the area specific rule first. I've also now added:
.DefaultForController().Is("Admin")
to the admin rule which worked. But then some of my redirects failed
from inside the admin area back to the controllers with areas. I used:
Redirect("", "Home", "Index")
But MR assumed that the home controller was inside the Admin area but
it isn't. Do you know how to redirect to a controller that doesn't
have an area?
Andy
On May 11, 3:49 pm, Jimmy Shimizu <[email protected]> wrote:
> Oh, I didn't know that.
>
> Well, do you add your area-specific rules before the non-area specific
> rules?
>
> andypike wrote:
> > From the spec (http://using.castleproject.org/display/MR/Routing+Spec)
> > I thought that [] where optional where as <> are required.
>
> > I've tried that but it still falls over ;o(
>
> > On May 11, 2:44 pm, Jimmy Shimizu <[email protected]> wrote:
>
> >> In which order do you add those rules? You should add the msot specific
> >> routes first since I believe it evaluates in the added order.
>
> >> And, since Area is a MonoRail-feature, maybe you should try this:
>
> >> rules.Add(new PatternRoute("[area]/[controller]/[action]")
> >> .DefaultForArea().Is("")
> >> .DefaultForController().Is("Users")
> >> .DefaultForAction().Is("Index"));
>
> >> This was just a wild guess from my side though :)
>
> >> This is old routing-syntax, right? Since the new routing-engine uses
> >> <controller> instead of [controller]
>
> >> andypike wrote:
>
> >>> Hi all,
>
> >>> I'm sure this is an easy thing to do, however I am too stupid to
> >>> figure it out. Basically I have a MR application which has some
> >>> controllers that are within an area and some that are not. I have the
> >>> following routes specified:
>
> >>> rules.Add(new PatternRoute("[controller]/[action]")
> >>> .DefaultForArea().IsEmpty
> >>> .DefaultForController().Is("Home")
> >>> .DefaultForAction().Is("Index"));
>
> >>> Some of my controllers are now inside an area called "Admin" so I
> >>> added the following as an extra rule:
>
> >>> rules.Add(new PatternRoute("Admin/[controller]/[action]")
> >>> .DefaultForController().Is("Users")
> >>> .DefaultForAction().Is("Index"));
>
> >>> But this didn't work. I've tried a number of different combinations
> >>> but can't find the magic formula. Any suggestions would be great.
>
> >>> Thanks in advance
>
> >>> Andy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---