Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
Line 3: @using Umbraco.Web.Models
Line 4: @{
**Line 5: IEnumerable<Link> footerLinks = Model.Value<IEnumerable<Link>>
("footerLinks",
fallback: Fallback.ToAncestors);**
Line 6: }
Line 7: <footer id="footer">
Unfortunately, this was not the solution. I really appreciate the input though. The footer is for global use, not page by page basis. If it helps, I'll attach a picture of my structure.
The guide doesn't account for different setups, what has confused me is the use of a model when this isn't a custom model. In fact, I was able to access it with this instead:
Trouble with MultiUrlPicker
Hi,
I am having some trouble using the core URL picker. I followed the documentation exactly but my model is always null.
Here's the relevant cshtml from my _Footer partial, which is rendered by a site layout controller in my master template.
_Footer.cshtml
Controller
Master
Error
CMS
Any help would be really appreciated.
Hi Patrick,
Is your footerLinks on the same page that you are trying to access. I think it could be one level up and so you need to add below code.
Hi Shaishav,
Unfortunately, this was not the solution. I really appreciate the input though. The footer is for global use, not page by page basis. If it helps, I'll attach a picture of my structure.
Fix:
The guide doesn't account for different setups, what has confused me is the use of a model when this isn't a custom model. In fact, I was able to access it with this instead:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.