Search Custom Control across multiple pages
We have few controls that are developed long back and i am not sure they are used anywhere in the pages (many pages to search manually), is there a better way to search a .ascx control in which pages it's been used? Is there a better way to make a control obsolete without impacting the page? Please advise.
Hi Lalit,
Thank you for contacting Siteifnity support.
First search these user controls in your solution and check if they are used in your custom widgets or master pages. If these ascx-s are Sitefiniity widgets can search for them in the database is [sf_object_data] table. There you can select all the rows where you control is used like this:
SELECT
*
FROM
[YourSitefinityDataBase].[dbo].[sf_object_data]
where
object_type =
'<put the full type name of your control. Ex: Telerik.Sitefinity.Web.UI.PublicControls.LoginWidget>'
Thanks for the reply Strahil, it was very helpful.
Below query gives all the pages
SELECT *
FROM [YourSitefinityDataBase].[dbo].[sf_page_data]
where content_id IN (SELECT distinct page_id FROM [YourSitefinityDataBase].[dbo].[sf_object_data]
WHERE object_type = '<put the full type name of your control. Ex:Telerik.Sitefinity.Web.UI.PublicControls.LoginWidget>'
and page_id IS NOT NULL)