Home / Community & Support / Knowledge Base / RadControls for ASP.NET AJAX / General, Installation, Licensing / Changing the location of the RadControls or setting Scripts folder

Changing the location of the RadControls or setting Scripts folder

Article Info

Rating: 4

 

Article information

Article relates to

all Telerik controls and versions

Created by

Robert, Telerik

Last modified

February 20, 2008

Last modified by

Stephen, Telerik





Description
The RadControls folder contains the various resources needed by the Telerik RadControls components (i.e. images, client-side scripts, localization files, configuration files, skins, etc.) when the UseEmbeddedScripts property of the control is set to false. With embedded resources disabled or using predefined skin which differs from Default, each component seeks for its resources (client scripts, skin definitions, etc.) in the respective subfolder of RadControls, for example, /RadControls/Spell for the RadSpell and /RadControls/Editor for the RadEditor.

By default, the RadControls folder is located in the root of the web-application (~/RadControls/). However, you can move the folder to a different location if needed.

NOTE: The approaches suggested in this article will not work when you're using the built-in VS 2005 web server. They will only work when your site is running in IIS because the VS 2005 internal server does not support virtual directories. If you are testing locally (and not using IIS), you must have a copy of the RadControls folder in your web application.

Moving the folder within your web-application

  1. Manually copy the RadControls to the new location within your web application (say ~/Resources/). Do not use VS to do this for you as it will change the file namespaces and project language from C# to VB, which in turn will break your application.
     
  2. Either:
    • Specify its position in the RadControlsDir property in the control's declaration in your ASCX/ASPX file (do not set it in the ConfigFile.xml), e.g.
       
      <radE:RadEditor
          RadControlsDir="~/Resources/RadControls">
          ...
      </radE:RadEditor>

      OR
       
    • set the property globally from the Web.config file of the application:  
       
      <configuration>
          <appSettings>
              <add key="Telerik.WebControls.RadControlsDir"
              value="~/Resources/RadControls/"/>
          </appSettings>
      </configuration> 
       
      where the tilde "~" represents the root of your web-application.

 
Moving the folder outside your web-application

This is the best scenario if you want to have single RadControls folder for several applications. Note that under .NET2 this works on IIS projects only (Cassini projects are not supported).

  1. Manually copy the RadControls to the new location (say C:/Resources/). Do not use VS to do this for you as it will change the file namespaces and project language from C# to VB, which in turn will break your application.
     
  2. Create a virtual directory with name RadControls under each application root which points physically to the same physical folder. That physical folder should include all the scripts and other required settings of the controls. Note that such mechanism enables different versions of our products to reside in different web applications - just change the reference of the virtual folder to other physical path when you want to use other version of some control.
     
  3. Please, keep in mind that in such scenario it is very important that the respective RadControls virtual directories should not be web application but virtual directories only.
     
  4. Give full permissions to the ASPNET user (under IIS5) or to the Network Service account (under IIS6) on the RadControls folder. Make sure that the permissions are inherited by all files within the folder (we will suggest forcing a permission replacement on all child objects within the folder, to make sure that no further problems pop up).
     
  5. Specify the position of the RadControls folder in the RadControlsDir property in the editor's declaration in your ascx/aspx file as shown below (do not set it in the ConfigFile.xml):

    <radE:RadEditor
        ...
        RadControlsDir="~/RadControls">
    </radE:RadEditor>

    where the tilde "~" represents the root of your web-application.

  

Description
In this version of RadControls there is a set of 11 common skins embedded in the assembly along with the client scripts of each control. When the EnableEmbeddedScripts property of the control is set to false each component will seeks for its client scripts in the location:

  •  specified by the RadScriptManager's Scripts collection holding a set of ScriptReferences, for example:

    <telerik:RadScriptManager id=”RadScriptManager1”runat=”server”> 
     <Scripts> 
        <asp:ScriptReference name=””Assembly=””Path=”~/Scripts/RadGrid/RadGridScripts.js”> 
     </Scripts> 
    </telerik:RadScriptManager>  

    (assuming that the Scripts folder resides in the root of your web site)
  • specified by a script register tag in the head section of the page, namely:

    <SCRIPT LANGUAGE="JavaScript" SRC="~/Scripts/Common/RadGrid/RadGridScripts.js"></SCRIPT> 
     

    (again assuming that the Scripts folder resides in the root of your web site)

The Scripts folder is located in the root of the RadControls installation (~/Scripts/) or at the same location in the zipped hotfix respectively. Under the Scripts sub-folder you will find a set of sub-folders holding each control's external client scripts, for example Scripts/RadAjax for RadAjax, Scripts/RadMenu for RadMenu, etc. Additionally, Scripts/Common folder holds the common scripts shared among all RadControls.

 

Comments

  • Jim Moore , Mar 19, 2007

    There is always the option of using a junction point in the project to point to the installed RadControls. A more sophisticated approach would be to use the before and after run events to create and delete the junction point at runtime.

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.