开发者

Umbraco Macro raise Null Reference error

开发者 https://www.devze.com 2023-01-31 07:37 出处:网络
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

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.RenderT开发者_如何学编程emplate(Int32 PageId, Int32 TemplateId)'

Please help me!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消