0

I have created a generic handler in a Episerver 7.5 project.

In this handler i want to inherit methods from the PageBase Class. My code looks like this:

public class GetMapCoordinates : PageBase, IHttpHandler
{
    public override void ProcessRequest(HttpContext context)
    {
        PropertyCriteriaCollection criterias = new PropertyCriteriaCollection();
        PropertyCriteria criteria = new PropertyCriteria();
        criteria.Condition = CompareCondition.Equal;
        criteria.Name = "PageTypeID";
        criteria.Type = PropertyDataType.PageType;
        criteria.Value = Locate.ContentTypeRepository().Load("HotelDetailPage").ID.ToString();
        criteria.Required = true;

        criterias.Add(criteria);

        PageDataCollection _newsPageItems = Locate.PageCriteriaQueryService().FindPagesWithCriteria(PageReference.StartPage, criterias);
    }

    public new bool IsReusable
    {
        get
        {
            return false;
        }
    }
}

I have been trying to find other classes that inherit from the PageBase class but I have not been able to find it. I can not modify the PageBase class since it is locked as metadata in the project.

Is there another way arround this? Note that I said that I can not modify the PageBase class and add a constructor.

petelids
  • 12,305
  • 3
  • 47
  • 57
ThunD3eR
  • 3,216
  • 5
  • 50
  • 94

1 Answers1

0

I have been at this since yesterday but minutes after puting the question here i found the answer...

Apperently episerver has a class called "SimplePage" that inherits the PageBase class.

   public class GetMapCoordinates : SimplePage, IHttpHandler
    {
        public override void ProcessRequest(HttpContext context)
        {
            PropertyCriteriaCollection criterias = new PropertyCriteriaCollection();
            PropertyCriteria criteria = new PropertyCriteria();
            criteria.Condition = CompareCondition.Equal;
            criteria.Name = "PageTypeID";
            criteria.Type = PropertyDataType.PageType;
            criteria.Value = Locate.ContentTypeRepository().Load("HotelDetailPage").ID.ToString();
            criteria.Required = true;

            criterias.Add(criteria);

            PageDataCollection _newsPageItems = Locate.PageCriteriaQueryService().FindPagesWithCriteria(PageReference.StartPage, criterias);
        }

        public new bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
ThunD3eR
  • 3,216
  • 5
  • 50
  • 94