Portable Areas and MVC 3

78 views
Skip to first unread message

JBeckton

unread,
Jul 2, 2011, 3:42:03 PM7/2/11
to mvccontrib-discuss
Is it possible to use Portable Areas as well as the local Areas that
are embedded into the main MVC application?

I am really struggling to get this to work. I can get a Portable Area
named Blogs to work but then if I add a local Area named Admin it does
not work.

Going the other way if I set up a local Area named Admin then a
Portable Area named Foo the Portable Area does not work.


I am on MVC 3, .Net 4

Jeremy Skinner

unread,
Jul 3, 2011, 4:07:35 AM7/3/11
to mvccontri...@googlegroups.com
My experience with portable areas is very limited, but my understanding is that this should work just fine (a portable area is just a regular area with some additions, so it should be completely possible to use them side by side). 

If one works but the second doesn't, then this suggests to me that you may have a routing problem. If the first area is always swallowing the route then it'll prevent the second from handling it. Have you tried using Phil Haack's RouteDebugger to see whether the URL is being handled by the correct area?

Jeremy


--
Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project.  Or go to http://mvccontrib.org

To unsubscribe from this group, send email to mvccontrib-disc...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mvccontrib-discuss?hl=en

JBeckton

unread,
Jul 3, 2011, 2:09:40 PM7/3/11
to mvccontrib-discuss
@Jeremy

I have been using Glimpse which has a routes plugin that allows me to
see all the available routes as well as which route was used to
service the request. But when a 404 occurs this tool is useless as
nothing is sent back in the response.

I guess I need some error handling in place that will provide some
details about the routing.


On Jul 3, 4:07 am, Jeremy Skinner <jer...@jeremyskinner.co.uk> wrote:
> My experience with portable areas is very limited, but my understanding is
> that this should work just fine (a portable area is just a regular area with
> some additions, so it should be completely possible to use them side by
> side).
>
> If one works but the second doesn't, then this suggests to me that you may
> have a routing problem. If the first area is always swallowing the route
> then it'll prevent the second from handling it. Have you tried using Phil
> Haack's RouteDebugger to see whether the URL is being handled by the correct
> area?
>
> Jeremy
>
> On 2 July 2011 20:42, JBeckton <jbeck...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Is it possible to use Portable Areas as well as the local Areas that
> > are embedded into the main MVC application?
>
> > I am really struggling to get this to work. I can get a Portable Area
> > named Blogs to work but then if I add a local Area named Admin it does
> > not work.
>
> > Going the other way if I set up a local Area named Admin then a
> > Portable Area named Foo the Portable Area does not work.
>
> > I am on MVC 3, .Net 4
>
> > --
> > Contact Jeffrey Palermo or Eric Hexter with specific questions about the
> > MvcContrib project.  Or go tohttp://mvccontrib.org

Jeremy Skinner

unread,
Jul 3, 2011, 2:13:19 PM7/3/11
to mvccontri...@googlegroups.com
You might want to try out something like route testing extension in MvcContrib.TestHelper. You could use this from within a unit test project to see whether or not the expected route is being invoked. 

Also, does the same problem occur if both Foo and Admin are regular areas, or is it only when one of them is portable?

Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project.  Or go to http://mvccontrib.org

JBeckton

unread,
Jul 3, 2011, 5:01:26 PM7/3/11
to mvccontrib-discuss
I was able to get them both working, I simply just deleted the area
and recreated it using the same steps.


I now have a PA and a regular area working but for some reason I
cannot get my PA to respond to "domain.com/Foo" but yet the regular
area will.



On Jul 3, 2:13 pm, Jeremy Skinner <jer...@jeremyskinner.co.uk> wrote:
> You might want to try out something like route testing extension in
> MvcContrib.TestHelper. You could use this from within a unit test project to
> see whether or not the expected route is being invoked.
>
> Also, does the same problem occur if both Foo and Admin are regular areas,
> or is it only when one of them is portable?
>

Jeremy Skinner

unread,
Jul 4, 2011, 4:13:57 AM7/4/11
to mvccontri...@googlegroups.com
Do the unit tests pass if you run this url through the route testing extensions in MvcContrib.TestHelper? Could you post the routes here?

Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project.  Or go to http://mvccontrib.org
Reply all
Reply to author
Forward
0 new messages