calling javascript from c#
<p>I need to use the javascript functions to show and hide an element on my page, but calling it from within a C# method.  Is this possible?</p>

<p>EDIT : I tried RegisterStartupScript (see below) but this did not hide the elements as I had hoped :</p>

<pre><code>HidePopup("CompanyHQSetup", "$('#&lt;%=DivDataProvider.ClientID %&gt;').hide();$('#&lt;%=modalOverlay.ClientID %&gt;').hide();");

private void HidePopup(string Key, string jscript)
    {
        string str = "";
        str += "&lt;script language='javascript'&gt;";
        str += jscript;
        str += "&lt;/script&gt;";
        RegisterStartupScript(Key, jscript);
    }
</code></pre>

<p>EDIT : Got around this by using a hidden field boolean to determine whether or not to hide or show the elements</p>
