English 中文(简体)
Html. 硕士中的性别
原标题:Html.RenderPartial in MasterPage

我试图从一个我不得不通过使用“放款人”的项目中组织一场大事,因为其法典确实是不可读的。 根据用户的作用,主要内容数据以某种方式显示。 我这样做了:

<!-- Header -->
<% Html.RenderPartial("SiteHeaderPartialView"); %>

<!-- Content -->
<% Html.RenderPartial("ContentPartialView"); %>

<!--Footer -->
<% Html.RenderPartial("SiteFooterPartialView"); %>

然后,在内容部分意见中,在检查用户的作用之后,我最后使用标签:

<asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder> 

但是,当该网站使我收到错误信息时,“Cannot在主页发现内容PlaceHolder MainContent”。 因此,我的问题是,是否有可能在总领馆使用放款人,并将人贩子带进他们? 为什么如此? 是否有另一种方式来重新组织硕士课程,以便我能够看到更清洁、更可读性? 事先感谢你的建议。

最佳回答

The asp:ContentPlaceHolder tag should be used in the Master page. 在内容网页上,需要使用<代码>:Content。 但是,通过<代码>Html.Render Partial,你不能使用这些编号,只是在指定地点插入了部分ASCX页。 因此,这里是形成布局的三种共同方式:asp:ContentPlaceHolder with asp:Content tags,Html.Render Partial and 。 Html.RenderAction/Html.Action helpers.

问题回答

暂无回答




相关问题
ASP.NET MVC ViewPage rendered in a ViewPage

I m wondering if it is possible to render a ViewPage inside of a ViewPage. Normally, you d have this: <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<my_object>"%> and then in ...

Rendering other controllers templates (Ruby on Rails)

I am building a sample site to familiarize myself with RoR. I followed the book "Agile Web Development with Rails" up to a point, and now I am experimenting and using it as a reference, however I ...

Asp.Net MVC - RenderPartial - Create in a List view

I got a page that lists all my articles (Articles/List.aspx). I also got a control that create article (Article/Create.ascx). I will like that my List.aspx page that s render the Create.ascx to be ...

RoR: partials with resources

I have a problem, trying to render partials in ruby on rails with the short notation for resoures. Somehow, RoR displays simply nothing that has to do with the partial, but i get no errors as well. I ...

热门标签