volume_up

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

volume_up

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

Newbie Question Nr.3

Hello everyone, its monday and I hope you all had a nice weekend!

Its the happy student back with another newbie question, note: I am working on/learning in episerver 4.60.

I am making a usercontrol that inherits from EPiServer.UserControlBase, and it is placed on the mainpage. It needs to access propertys from another page, how do I go about doing that?

Kind Regards
Pontus

#28947
Mar 30, 2009 13:31

Just load the page.

Something like (untested code from the top of my head :) ):

PageData page = Global.EPDatafactory.GetPage(new PageReference(page_id));

label1.text = page["mainbody"]  as string;

#28948
Mar 30, 2009 14:20
Ok problem solved, thank you Greger!
#28950
Mar 30, 2009 14:47

or page.Property["mainbody"] to get the value as a porperty.

page["mainbody"] will return the "inner" value of a property while using the Property[]will give you the value as the property.

#28967
Mar 30, 2009 23:30
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.