+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Moving custom controls from a folder to an other

Moving custom controls from a folder to an other

6 posts, 1 answered
  1. Lucas
    Lucas avatar
    65 posts
    Registered:
    22 Mar 2010
    08 Sep 2010
    Link to this post
    Hi,

    All our custom controls are currently in a '~/UserControls' folder (for example '~/UserControls/pageTitle.ascx'). For organisational purposes, we are going to move this folder to a new location ('~/readwrite/UserControls').

    Unfortunately, despite modifying our web.config file as such:
    <add name="Page Title" section="Navigation" url="~/readwrite/UserControls/PageTitle.ascx"/>

    our UI displays the following error (for the controls that were already inserted before the move):

    The file '/UserControls/PageTitle.ascx' does not exist.

    I imagine the ascx path is stored in the database somewhere. Can you tell me if that is the case (and where it is referenced), in order to run an update script?

    Thanks a lot!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Sep 2010
    Link to this post
    Hi Lucas,

    Check [sf_WebControlBase] table.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Lucas
    Lucas avatar
    65 posts
    Registered:
    22 Mar 2010
    08 Sep 2010
    Link to this post
    Thanks a lot Ivan!

    For those looking for the exact MS SQL query:

    UPDATE    sf_WebControlBase
    SET              Type = REPLACE(Type, '~/UserControls', '~/readwrite/UserControls')
    WHERE     (Type LIKE '~/UserControls%')
  4. Lucas
    Lucas avatar
    65 posts
    Registered:
    22 Mar 2010
    08 Sep 2010
    Link to this post
    Ivan,

    Apparently, some old paths are also already stored in some controls properties (DownloadList for example), I updated sf_CmsControlProperty to reflect that

    UPDATE    sf_CmsControlProperty
    SET     Value = REPLACE(Value, '~/UserControls', '~/readwrite/UserControls')
    WHERE     (Value LIKE '~/UserControls%')

    can you think of any other place I could have missed?
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Sep 2010
    Link to this post
    Hi Lucas,

    CmsControlProperty contains data for property values that are set through control designer. If you have referenced the control in some IContent you have to edit sf_CmsTextContent

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Lucas
    Lucas avatar
    65 posts
    Registered:
    22 Mar 2010
    08 Sep 2010
    Link to this post
    Thanks a lot for your help, Ivan!
Register for webinar
6 posts, 1 answered