Umbraco 宏引发空引用错误

发布于 2024-10-08 07:25:20 字数 235 浏览 0 评论 0原文

我创建了一个“PageNotFound”模板。当它被 URL 调用时,一切都很好。但是,当用户输入无效 URL 时显示,内部宏不会加载,并且在页面的源代码中我收到此错误:

生成宏内容时出错:'System.NullReferenceException:未将对象引用设置为对象的实例。在 umbraco.library.RenderTemplate(Int32 PageId, Int32 TemplateId)'

请帮助我!

I've created a "PageNotFound" template. When it is invoked by its URL everything is fine. But when it is shown when user entered an invalid URL, inner macros is not loaded and in the source code of the page I received this error:

Error generating macroContent: 'System.NullReferenceException: Object reference not set to an instance of an object. at umbraco.library.RenderTemplate(Int32 PageId, Int32 TemplateId)'

Please help me!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟火散人牵绊 2024-10-15 07:25:20

看来这可能是由于 RenderTemplate 方法中的错误< /a>.您是否绝对必须使用 RenderTemplate,或者是否有其他方法可以解决您想要做的事情。

如果您可以描述 RenderTemplate 位应该执行的操作,则可以推荐替代方案。

It seems that this could be due to a bug in the RenderTemplate method. Do you absolutely have to use RenderTemplate, or is there another way that you could solve what you're trying to do.

If you could describe what the RenderTemplate bit is supposed to do, an alternative can be recommended.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文