Write ClientSide code from Custom ASP .NET Extender server side ExtenderControlBase
<p>I'm extending <strong>ExtenderControlBase</strong> control in ASP .NET. It's called:</p>

<pre><code>public class LookupExtender : ExtenderControlBase
</code></pre>

<p>Basically what it doest in something similar to autocomplete function - but static. LookupExtender has <strong>TypeName</strong> &amp; <strong>ListName</strong> attritbutes that specify:</p>

<ul>
<li>class that has <strong>string[] GetList(string listName)</strong> method </li>
<li>name of the list that will be passed to GetList method</li>
</ul>

<p>And now, LookupExtender creates <strong>TypeName</strong> instance on the fly (reflection), calls <strong>GetList</strong> method and I would like to render <strong>string[]</strong> result to client side as array, so that extender client-side code has static source for autosuggestion.</p>

<p>Is there any way to render JavaScript from <strong>LookupExtender</strong> class?</p>

<p>This is my sample code (currently autosuggestion values are hardcoded):</p>

<pre><code>set_TargetTextBoxID: function (value) {
    this._targetTextBoxID = value;

    $(function () {
        var availableTags = [
            "Switzerland",
            "Poland",
            "Europe",
            "USA",
            "Asia"
        ];
        $("#" + value).autocomplete({
            source: availableTags,
            minLength: 0,
            close: function () {
                $(this).blur();
            }
        }).focus(function () {
            $(this).autocomplete("search", "");
        });
    });
}
</code></pre>
