无法在Umbraco中使用webform模板在页面上添加内容

时间:2016-04-08 23:35:48

标签: asp.net templates webforms umbraco master-pages

我正在使用umbraco 7而且我对MVC并不是很好,所以我使用的是webforms,当我尝试使用webform模板时,我无法在页面上添加内容,只是在模板上。

这里我在de default.master文件中使用这样的contentplace holder:

<div id="mainContent">
 <asp:ContentPlaceHolder id="MainContent" runat="server">
 </asp:ContentPlaceHolder>
 </div>

然后我创建名为“Text Webform”的模板,这是代码:

<%@ Master Language="C#" MasterPageFile="~/umbraco/Masterpages/Default.master" AutoEventWireup="true" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    This content is displayed

    Am i forgetting some code to add here?

</asp:Content>

Click on this to see screenshot

问题是,当我尝试在使用“文字网络表单”模板的页面中添加内容时,该内容不会显示,您可以在屏幕截图中看到here

我确定我需要在Text Webform模板中添加一些内容,但我不确切知道什么,我很绝望,请有人提供任何帮助,

感谢。

2 个答案:

答案 0 :(得分:0)

您必须定义哪些字段(例如文档类型中的属性)以显示模板中的位置。我相信这就是你要找的东西? https://our.umbraco.org/documentation/Reference/Templating/Masterpages/umbracoitem - 只是

答案 1 :(得分:0)

好的,现在我可以更好地解释一下,

我只想使用webform模板对@ CurrentPage.GetGridHtml(“content”,“fanoe”)进行相同的功能..