简体   繁体   English

umbraco的母版页

[英]master page in umbraco

i'm programming in asp.net with umbraco and have a problem with master page. 我正在使用umbraco在asp.net中编程,并且母版页有问题。 i made a master page then added a web user master page that link in my default page. 我创建了一个母版页,然后添加了一个链接在我的默认页面中的Web用户母版页。 at run time project in umbraco when i click on link saw this error : 在umbraco的运行时项目,当我点击链接时看到此错误:

Page not found 网页未找到

No umbraco document matches the url 'http://localhost:20771/WebForm1.aspx' 没有umbraco文档匹配网址'http:// localhost:20771 / WebForm1.aspx'

umbraco tried this to match it using this xpath query'/root/* [@urlName = "webform1"] | umbraco尝试使用此xpath查询来匹配它'/ root / * [@urlName =“webform1”] | /root/ / [@urlName = "webform1"]') / root / / [@urlName =“webform1”]')

This page can be replaced with a custom 404 page by adding the id of the umbraco document to show as 404 page in the /config/umbracoSettings.config file. 通过添加umbraco文档的ID以在/config/umbracoSettings.config文件中显示为404页面,可以将此页面替换为自定义404页面。 Just add the id to the '/settings/content/errors/error404' element. 只需将id添加到'/ settings / content / errors / error404'元素即可。

For more information, visit information about custom 404 on the umbraco website. 有关更多信息,请访问umbraco网站上有关自定义404的信息。

This page is intentionally left ugly ;-) 这个页面故意留下丑陋;-)

i search in web and did not find any solution about it. 我在网上搜索,没有找到任何解决方案。

Check that your master page shows up in the admin area via Settings > Templates. 通过设置>模板检查您的母版页是否显示在管理区域中。 Then, check that your content page (in the admin Content section) has a template defined (under "Generic properties"). 然后,检查您的内容页面(在“管理内容”部分中)是否已定义模板(在“通用属性”下)。 If it doesn't, and it doesn't let you select a template, then you need to allow that template to be used for that particular node type. 如果没有,并且它不允许您选择模板,那么您需要允许该模板用于该特定节点类型。 Go to Settings > Document Types, select your node type, and under "Allowed templates", select the template that you wish to us for the page (you may select a nested masterpage, it should still work just fine) - also make sure that the "Default allowed template" underneath is selected to your chosen template. 转到设置>文档类型,选择您的节点类型,然后在“允许的模板”下,选择您希望我们为该页面设置的模板(您可以选择嵌套的母版页,它仍然可以正常工作) - 同时确保下面的“默认允许模板”将选择到您选择的模板。 Once you have hit "Save", go back to your node in the Content section, go to the "Generic properties" tab, and select the template you wish. 点击“保存”后,返回“内容”部分中的节点,转到“通用属性”选项卡,然后选择所需的模板。

Umbraco lets you use any number of masterpages for rendering a content node. Umbraco允许您使用任意数量的主页来呈现内容节点。 When creating new nodes, you then choose the template you wish to use (or use the default, as specified by following the above instructions). 在创建新节点时,您可以选择要使用的模板(或使用默认值,如上面的说明所指定)。 You can also force a different template to be used at runtime, using the ?altTemplate=MyTemplateName querystring option on your page URL - handy for mobile sites, RSS views, and suchlike. 您还可以在运行时强制使用不同的模板,使用页面URL上的?altTemplate = MyTemplateName查询字符串选项 - 方便移动网站,RSS视图等。

In Master.master page (it's general master page.) you can locate asp:ContentPlaceHolder 在Master.master页面(它是一般的母版页。)中,您可以找到asp:ContentPlaceHolder

please attention to this code.Perhaps it's help you. 请注意这个代码。也许它对你有所帮助。

  <div style="vertical-align: top;"> <umbraco:Macro ID="Macro1" Alias="NavigationControl" runat="server"></umbraco:Macro> </div> ***<div> <asp:ContentPlaceHolder ID="DefaultPageContent" runat="server"> </asp:ContentPlaceHolder> </div>*** <div> <asp:ContentPlaceHolder ID="TextPageContent" runat="server"> <!-- Insert default "ContactUsContent" markup here --> </asp:ContentPlaceHolder> </div> <div> <asp:ContentPlaceHolder ID="AtAGlanceContent" runat="server"> </asp:ContentPlaceHolder> </div> <div id="footer"> <uc6:FooterControl ID="FooterControl1" runat="server" /> </div> </div> </form> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM