Nevron .NET Vision
Nevron.UI.WebForm.Controls Namespace / NClientServerTechnology Class / EnumerateScriptIncludes Method


In This Topic
    EnumerateScriptIncludes Method (NClientServerTechnology)
    In This Topic
    Provides a list of web resources containing client side JavaScript include files.
    Syntax
    'Declaration
     
    
    Public Overridable Function EnumerateScriptIncludes() As System.Collections.ArrayList
    'Usage
     
    
    Dim instance As NClientServerTechnology
    Dim value As System.Collections.ArrayList
     
    value = instance.EnumerateScriptIncludes()
    public virtual System.Collections.ArrayList EnumerateScriptIncludes()

    Return Value

    A list of web resources containing client side JavaScript include files. The default implementation returns null (do not register any scripts).
    Remarks
    This method is called by the framework to determine, which JavaScript web resources must be registered with the web page script manager, if one is present. The single web resource must be specified in the following form: "Assembly.Full.Name/Optional/Folders/Path/ScriptFileName.js". Please notice the slashes that separate the assembly name, the folder path parts and the file name. The JavaScript web resource can be located in any assembly that can be loaded by the application.

    To add a JavaScript file as a web resource and load it by the AJAX-enabled control, do the following:

    • To the project of the assembly that will host the web resource add the JavaScript file and set its Build Action property to "Embedded Resource";
    • To the AssemblyInfo.cs file in the assembly that will host the web resource ensure using System.Web.UI; is present;
    • To the AssemblyInfo.cs file in the assembly that will host the web resource add an assembly attribute like this: [assembly: WebResource("Assembly.Full.Name.Optional.Folders.Path.ScriptFileName.js", "application/x-javascript")]
    • In the implementation of the EnumerateScriptIncludes() method add the web resource to the returned list like this: public override string[] EnumerateScriptIncludes() { string[] scriptFiles = { ... "Assembly.Full.Name/Optional/Folders/Path/ScriptFileName.js", ... }; return scriptFiles; }

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also