RadScriptManage and custom JS

2 posts, 0 answers
  1. Stephan
    Stephan avatar
    71 posts
    Member since:
    Jul 2007

    Posted 13 Nov 2008 Link to this post

    Hi, this is nearly the same as my presious post about the RadStyleSheetManager, but I've been reading the RadScriptManager tutorial, and again I'm not sure how I can use it. Just puting the RSM on the page is enough to combine all the call to JS-files?

    Or do I have to use
    <telerik:RadScriptManager id=””runat=””> 
      <asp:ScriptReference name=””Assembly=””Path=”/MyVirtualLocation/MyFile.js”> 

    to reference the custom-scripts.

    Is it also possible to put the script in a custome class (like suggested for the RadStyleSheetManager) to be included in a single request.

    I use the RSM on my masterpage, but I still see three script-tags in my html-output instead of one. So I would conclude the scripts are not embedded resources. But if I use the code above, and reference the correct path, it should combine, but then the  scripts are still not embedded.

    Hope it is clear to you what I'm trying to ask.

    Thanks for the reply

  2. Erjan Gavalji
    Erjan Gavalji avatar
    1455 posts

    Posted 14 Nov 2008 Link to this post

    Hi Stephan,

    RadScriptManager currently combines only scripts that are embedded resources to an assembly. If a ScriptReference has its Path property defined, it is automatically excluded from the combination and the combined script tag gets split (in order to keep possible references).

    You could use the RadStyleSheetManager approach to have the scripts combined though - embedding them in an assembly and registering them as ScriptReferences would do the job just perfectly. By the way, if you have an IScriptControl, which registers itsef to the ScriptManager (similar to the controls in the AjaxControlToolkit), RadScriptManager will include its scripts automatically to the combination.

    Kind regards,
    Erjan Gavalji
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
Back to Top