The javascript code from server side is not working in asp.net?
<p>i am developing an Asp.net application when i call javascript function from codebehind i found that for example:</p>

<ol>
<li>click event not fired</li>
<li>i have a javascript function that fill the dropdown list  with items using ajax but when page loaded i found dropdown list empty</li>
</ol>

<p>i am using RegisterClientScriptBlock to execute the javascript code</p>

<p>so is there any solution for these problems?</p>

<p>code snippet:</p>

<p>code behind:</p>

<pre><code>    ClientScript.RegisterClientScriptBlock(this.GetType(), "ClientBlock",   javacode.ToString());
</code></pre>

<p>this what in javacode variable :</p>

<pre><code>     &lt;script type="text/javascript"&gt;
     &lt;!--
     function ExecuteScript()
     {
    $("#divGender input").click();
     GetDMspecifyList(5); 
    $("cp1_drpDMSpecify").removeAttr('disabled'); 
    $("cp1_drpDMSpecify option:selected").val(4);
    $("#divFamily input").click();
     }
    &lt;/script&gt;
     // --&gt;
</code></pre>

<p>this the function used to fill dropdown list but it is not working</p>

<pre><code>    function GetDMspecifyList(DMID) {
    $("#DMLoader").show();
    $.getJSON('FillDropDownLists.aspx?DMTypeID=' + DMID, function (types) {
    $.each(types, function () {
        $("#cp1_drpDMSpecify").append($("&lt;option&gt;&lt;/option&gt;").val(this['DMTypeCode']).html(this['DMTypeName']));
    });
    $("#DMLoader").hide();
    $("#DMSpecify_span").show();
    $("#cp1_hdDMType").val($("#cp1_drpDMSpecify").val());
    $("#cp1_drpDMSpecify").removeAttr('disabled');
    });
</code></pre>

<p>} </p>
