views:

97

answers:

1

I have seen blog entries like ASP.Net MVC Portable Areas - Part 2 that indicate that the build action for views must be set to Embedded Resource.

What about other content such as images and CSS? Should they be set to Embedded Resource as well? Will the PortableArea ViewEngine pull that content out as well?

+2  A: 

EDIT:

As long as your images/css/scripts are marked as Embedded Resources and follow the following convention:

> Areas
    > AreaName
        > Content
            > Styles
               Site.css
            > Images
               myImage.jpg
            > Scripts
               site.js

You get it for free! The routes generated to the embedded resources are:

~/AreaName/Styles/Site.css
~/AreaName/Images/myImage.jpg
~/AreaName/Scripts/site.js
John Nelson
Doesn't seem to work with master pages though. <%@ Language="C#" MasterPageFile="~/Core/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> fails when trying with a portable area 'Core'
Sam
@Sam are you trying to embed the master page itself?
John Nelson
Yes, I'm trying to embed it and reference from another project
Sam