开发者

ASP.NET MVC partial in a Portable Area not found

I'm trying to include a partial in a view. Both the partial and the view are in an MVC Portable Area. Here's the code in the view:

<% Html.RenderPartial("Here"); %>

Here's the partial (named Here.ascx and located in the Shared folder of my portable area):

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
    <p>
        Here
    </p>
    <p>
        You found me.
    </p>

The result is: The partial view 'Here' was not found. I've also tried specifying the relative path开发者_高级运维 to this partial too, but with no luck. Any ideas?


All views (and partials and templates) must be embedded resources rather than content files. You define this in the "Build Action" property. To make a partial an embedded resource, highlight it in Solution Explorer and press the F4 key, or right-click it and select Properties from the context menu.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜