ASP.NET MVC 3 Razor - Portable Areas

833 views
Skip to first unread message

Timur Zanagar

unread,
Sep 29, 2011, 9:40:51 AM9/29/11
to mvccontri...@googlegroups.com
Hi folks,

I would like to know if MvcContrib Portable Areas are working together with Razor?

Just created 2 ASP.NET MVC 3 Razor projects and wanted to get this running, but getting several errors about not finding the model or the base page have to be a WebViewPage. Can't understand the problems. Registering is no problem and the routes are working and it can find the views but there are not compiled or rendered.

Eric Hexter

unread,
Oct 2, 2011, 7:01:47 AM10/2/11
to mvccontri...@googlegroups.com
Portable Areas were created to fill the gap of reusing areas in different projects.  That said we came up with the idea in MVC2.  That being said they were initially developed with webforms in mind.  Now that we are in MVC 3 and more importantly have a tool like nuget. It makes more sense to use and regular Area and nuget to create your portable area instead of the embedded view engine.  The portion of mvccontrib portable areas that should still be used is the Bus used for communication.
--
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

Timur Zanagar

unread,
Oct 3, 2011, 4:29:49 AM10/3/11
to mvccontri...@googlegroups.com
This sounds interesting. Just thinking about how to achive this... Let's see if there is a solution for my problem. If you've more information about MVC 3 / regular Area --> portable Area, please don't hesistate and provide them.

zippy

unread,
Oct 5, 2011, 4:32:58 PM10/5/11
to mvccontrib-discuss
I would like to know how to provide a bolt on type approach to a core
MVC 3 app to provide a plugin type architectire. Portable Areas was
recommended but perhaps its not the right approach. Here is a bit
more about what I would like to do -
http://stackoverflow.com/questions/4713133/asp-net-mvc-providing-bolt-on-functionality-to-existing-web-app

Could you answer the question or reply to this thread?

Many Thanks

On Oct 2, 12:01 pm, Eric Hexter <eric.hex...@gmail.com> wrote:
> Portable Areas were created to fill the gap of reusing areas in different
> projects.  That said we came up with the idea in MVC2.  That being said they
> were initially developed with webforms in mind.  Now that we are in MVC 3
> and more importantly have a tool like nuget. It makes more sense to use and
> regular Area and nuget to create your portable area instead of the embedded
> view engine.  The portion of mvccontrib portable areas that should still be
> used is the Bus used for communication.
>
> Eric Hexter
>
> blog |http://Hex.LosTechies.com
> info |http://www.linkedin.com/in/erichexter
>
> On Thu, Sep 29, 2011 at 8:40 AM, Timur Zanagar <timur.zana...@googlemail.com
>
>
>
>
>
>
>
> > wrote:
> > Hi folks,
>
> > I would like to know if MvcContrib Portable Areas are working together with
> > Razor?
>
> > Just created 2 ASP.NET MVC 3 Razor projects and wanted to get this
> > running, but getting several errors about not finding the model or the base
> > page have to be a WebViewPage. Can't understand the problems. Registering is
> > no problem and the routes are working and it can find the views but there
> > are not compiled or rendered.
>
> > --
> > Contact Jeffrey Palermo or Eric Hexter with specific questions about the
> > MvcContrib project. Or go tohttp://mvccontrib.org

Timur Zanagar

unread,
Oct 6, 2011, 6:56:44 AM10/6/11
to mvccontri...@googlegroups.com
Hi Eric,

I just tried some stuff and don't know how to handle this with NuGet. Is it possible to give some more information about Portable Area's and NuGet?

If I understand you right, I've to create a portable Area like creating a Empty ASP.NET MVC 3 project. Create my "portable" Area in this project and get the *.cshtml files within a NuGet Package and the Models / Controllers stuff as compiled class library. Is this right or do you've a better solution?

Eric Hexter

unread,
Oct 6, 2011, 9:42:56 PM10/6/11
to mvccontri...@googlegroups.com
Checkout Chapter 22 of the MVC 3 in Action book.  It has not been published yet, but this is the main content for the portable areas.
 

--

Timur Zanagar

unread,
Oct 7, 2011, 3:20:32 AM10/7/11
to mvccontri...@googlegroups.com
Hi Eric,

Just read this chapter and created a test solution. Like in your chapter your describe to use PortableAreaRegistration from MvcContrib, but in my test I didn't needed it. So what is the benefit to use PortableAreaRegistration like you used it in your chapter? Is it, because you describe the way how to do it in MVC 2? Can't see any comments of MVC 3...

Don't understand me wrong - I just want to understand you chapter and your first answer here. You said that there is no need to use PortableAreaRegistration cause you needed it for MVC 2.

zippy

unread,
Oct 7, 2011, 10:25:37 AM10/7/11
to mvccontrib-discuss
I'm following this thread with great interest as I would like to
create a plugin/bolt-on architecture for a core MVC 3 app. I will look
into Eric's Chapter 22 but look forward to his response to Timur.

I have also found a question on stackoverflow which uses MEF to
provide plugin architecture which might be worth a look. I'm new to
this so not sure what the difference is compared to Portable Areas so
would like Eric's feedback if possible.
http://stackoverflow.com/questions/7361157/mvc-3-and-mef-and-adding-plug-ins-to-main-application
Reply all
Reply to author
Forward
0 new messages