Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC Contrib Portable areas and static content
    primarykey
    data
    text
    <p>I have followed a couple of guides on how to serve static content from a portable area but with no luck. I have two projects, a web project and a class library (which serves as my portable area). In my portable area (lets call it 'MyArea' for namesake) I have a Content folder with three folders inside that, Scripts, Styles, Images. </p> <p>In the Scripts folder I have a simple js file as an embedded resource ('Hello.js'). My understanding is that the RegisterDefaultRoutes method called by RegisterArea creates routes for these which map to the following urls:</p> <p>directory /Areas/AreaName/Content/Images maps to the URL /AreaName/Images </p> <p>directory /Areas/AreaName/Content/Styles maps to URL /AreaName/Styles </p> <p>directory /Areas/AreaName/Content/Scripts maps to URL /AreaName/Scripts</p> <p>My layout view (_layout.cshtml) (which is in my web project which imports the MyArea project as a project reference) has the following in the head:</p> <pre><code>&lt;script src="@Url.Content("~/MyArea/Scripts/Hello.js")" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>However, inspecting this returns a 404 so I must be doing something wrong</p> <p>I have also followed the guides below with no luck</p> <p><a href="http://geekswithblogs.net/michelotti/archive/2010/04/13/mvc-portable-areas-enhancement-ndash-embedded-resource-controller.aspx" rel="nofollow">http://geekswithblogs.net/michelotti/archive/2010/04/13/mvc-portable-areas-enhancement-ndash-embedded-resource-controller.aspx</a></p> <p><a href="http://groups.google.com/group/mvccontrib-discuss/browse_thread/thread/b5f9c77f3a7523ff" rel="nofollow">http://groups.google.com/group/mvccontrib-discuss/browse_thread/thread/b5f9c77f3a7523ff</a></p> <p>What am I doing wrong?</p> <p>Thanks very much.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload