<p>
        A behavior adds functionality to client Document Object Model (DOM) elements. The client behavior can be encapsulated in a Web server control as an extender control. The extender control is then associated with one or more types of ASP.NET server controls to add the behavior to those server controls. You can associate more than one extender control with an ASP.NET server control. An extender control is a web server control that inherites the ExtenderControl. GetScriptDescripters returns a collection of ScriptDescriptor objects that contain information about instances of client components that are used with web server control. This includes the client type to create, the properties to assign, and the events to add handlers for. See the script example below, they will be generated according to this information. GetScriptReferences() returns a collection of ScriptReference objects that contains information about the client-script libraries to be include with then control. The client-script libraries define the client types and include any other javascript code that is required for the control.
        </p>


        <pre data-sub="prettyprint:_">
        protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
        {
        ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor("Samples.FocusBehavior", targetControl.ClientID);
        descriptor.AddProperty("highlightCssClass", this.HighlightCssClass);
        descriptor.AddProperty("nohighlightCssClass", this.NoHighlightCssClass);

        return new ScriptDescriptor[] { descriptor };
        }
        </pre>



        <pre data-sub="prettyprint:_">
        <script type="text/javascript">

        Sys.Application.initialize();
        Sys.Application.add_init(function() {
        $create(Samples.FocusBehavior, {"highlightCssClass":"HighLight","nohighlightCssClass":"LowLight"}, null, null, $get("TextBox1"));
        });
        Sys.Application.add_init(function() {
        $create(Samples.FocusBehavior, {"highlightCssClass":"HighLight","nohighlightCssClass":"LowLight"}, null, null, $get("TextBox2"));
        });
        Sys.Application.add_init(function() {
        $create(Samples.FocusBehavior, {"highlightCssClass":"HighLight","nohighlightCssClass":"LowLight"}, null, null, $get("TextBox3"));
        });
        Sys.Application.add_init(function() {
        $create(Samples.FocusBehavior, {"highlightCssClass":"HighLightButton","nohighlightCssClass":"LowLightButton"}, null, null, $get("Button1"));
        });

        </script>
        </pre>