ExternalClientScripts - Using a embedded resource - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

ExternalClientScripts - Using a embedded resource

  • ExternalClientScripts - Using a embedded resource
  • In the products sample, in the ProductsDefinitions.cs file, there is a method "ExternalClientScripts" of "productsGridView" that takes an external script as input.

    Since this is a static class of definitions how would you specify an embedded resource?
  • Hi Victor,

    Try to use the following code:
    var externalScripts = new Dictionary<string, string>();
    externalScripts.Add("YourModule.Resources.MasterListViewExtensions.js, YourModule", "OnMasterViewLoaded");
    productsGridView.ExternalClientScripts = externalScripts;

    and the code of embedded javascript file:
    // called by the MasterGridView when it is loaded
    function OnMasterViewLoaded(sender, args)
        //your code here

    Note: the build action of MasterListViewExtensions.js should be Embedded Resource.

    I hope this helps.

    Best wishes,
  • Genius!

    Thanks, it worked perfectly.