gpt4 book ai didi

c# - Umbraco 中的母版页

转载 作者:行者123 更新时间:2023-11-30 12:12:33 28 4
gpt4 key购买 nike

我正在使用 umbraco 在 asp.net 中编程,但母版页有问题。我制作了一个母版页,然后添加了一个链接到我的默认页面的网络用户母版页。在 umbraco 的运行时项目中,当我单击链接时看到此错误:

Page not found

No umbraco document matches the url 'http://localhost:20771/WebForm1.aspx'

umbraco tried this to match it using this xpath query'/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. Just add the id to the '/settings/content/errors/error404' element.

For more information, visit information about custom 404 on the umbraco website.

This page is intentionally left ugly ;-)

我在网上搜索并没有找到任何解决方案。

最佳答案

通过“设置”>"template"检查您的母版页是否显示在管理区域中。然后,检查您的内容页面(在管理内容部分)是否定义了模板(在“通用属性”下)。如果没有,并且它不允许您选择模板,那么您需要允许该模板用于该特定节点类型。转到“设置”>“文档类型”,选择您的节点类型,然后在“允许的模板”下,为页面选择您希望我们使用的模板(您可以选择一个嵌套的母版页,它应该仍然可以正常工作)-还要确保下面的“默认允许模板”被选择为您选择的模板。点击“保存”后,返回“内容”部分中的节点,转到“通用属性”选项卡,然后选择所需的模板。

Umbraco 允许您使用任意数量的母版页来呈现内容节点。创建新节点时,您可以选择要使用的模板(或按照上述说明使用默认模板)。您还可以强制在运行时使用不同的模板,使用页面 URL 上的 ?altTemplate=MyTemplateName 查询字符串选项 - 对于移动站点、RSS View 等非常方便。

关于c# - Umbraco 中的母版页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13430813/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com