A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hi,
That's because PageLink is not always an int. In edit mode it also has a work id, so you need to treat PageLink as a string. If you just want the just the id, you can do CurrentPage.PageLink.ID.
Or:
var pageReference = CurrentPage.Property["PageLink"] as PageReference;
var id = pageReference.ID;
The code below only gives the expected result while viewing the page but not in edit mode. Any idea why?
int i;
int.TryParse(CurrentPage.Property["PageLink"], out i);