开发者

How is other content besides views handled with PortableAreas from the MVCContrib library?

开发者 https://www.devze.com 2022-12-25 23:03 出处:网络
I have seen blog entries like ASP.Net MVC Portable Areas - Part 2 that indicate that the build action for views mu开发者_StackOverflow社区st be set to Embedded Resource.

I have seen blog entries like ASP.Net MVC Portable Areas - Part 2 that indicate that the build action for views mu开发者_StackOverflow社区st 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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消