Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Dynamicweb.Frontend.Page.FindPage(xx).Children

Dynamicweb.Frontend.Page.FindPage(xx).Children

Gorm Mortensen
Reply

Hi forum.

After upgrading from 8.8 to 9.1.4 I get this error:

'Dynamicweb.Frontend.Page' indeholder ikke en definition til 'Children', og der blev ikke fundet en udvidelsesmetode 'Children', der accepterer et første argument af typen 'Dynamicweb.Frontend.Page' (mangler du en 'using'-direktiv eller en assemblyreference?)

Can't I use Dynamicweb.Frontend.Page in DW9? This code works fine in DW8 (http://www.verpan.com/products/lighting/vp-globe-glass-small)

Ths is my assemblies:

@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
@using System.Text;
@using System.Web;
@using System.IO;
@using Dynamicweb.Content.Items;
@using Dynamicweb;

Thank you

Best regards,

Gorm / Ecreo


Replies

 
Morten Buhl Dynamicweb Employee
Morten Buhl
Reply

Hi Gorm

Use Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPage(Int32 id) instead - see http://doc.dynamicweb.com/releases-and-downloads/releases/upgrading/dw9-api-cheatsheet

/Morten Buhl, DW

 
Gorm Mortensen
Reply

Hi Morten.

Thank you. 

I ended up using Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPagesByParentID(int32 id) to get the children of the parent with id xx. 

And @using Dynamicweb.Content btw

Best regards,
Gorm

 

You must be logged in to post in the forum