Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
private readonly ISiteSettings _siteSettings;
public ProductPageBase(ISiteSettings siteSettings)
{
_siteSettings = siteSettings;
}
public ProductPageBase()
{
_siteSettings = ServiceLocator.Current.GetInstance<ISiteSettings>();
}
Is is possibel to use depnedcy injection with page type. I'm trying to do the following
But i am getting the following error
Type 'Cds.Nitb.Web.Models.Pages.Product.ActivityPage' does not have any public default constructor and no IConstructorParameterResolver that handles it
I know that ISiteSettings does work with DI (StructureMap) as I am using it elsewhere. Is there soemthing else I need to do to getting it working with page types.
Thanks
(Note- this could be an EPiServer Find nissue as the code crashes at the point where I do a find call - maybe not though)
Type 'Cds.Nitb.Web.Models.Pages.Product.ActivityPage' does not have any public default constructor and no IConstructorParameterResolver that handles it