How can I get the page that contains a specific control?

Posted by Community Admin on 05-Aug-2018 16:36

How can I get the page that contains a specific control?

All Replies

Posted by Community Admin on 17-Mar-2011 00:00

I want to get a list of pages that contains a specific control. How can this be done?

Posted by Community Admin on 17-Mar-2011 00:00

Hi Bruno Michels,

You can find an example for this in the news rotator sample control in the Sitefinity SDK.

Best wishes,
Radoslav Georgiev
the Telerik team

Posted by Community Admin on 01-Apr-2011 00:00

var pageNodes = App.WorkWith().Pages().LocatedIn(PageLocation.Frontend)
    .Where(p => p.Page != null &&
        p.Page.Controls.Where(c => c.ObjectType.StartsWith(typeof(CONTROLTYPE).FullName)).Count() > 0)
    .Get()
    .ToList();

Gets a list of pages with the specific control

This thread is closed