Executing client-side script on link click
<p>I need my web page to open a window and enable a disabled button when a link or a button is clicked.
From what I've read on other posts on here, if I try and open a new window in Page_load most browsers will assume it's a pop-up and block it so I've been trying to do it client side with JS. </p>

<p>Currently, I'm trying it with a link declared like so:</p>

<p><code>Please click &lt;a href="javascript:OpenDoc()"&gt;here&lt;/a&gt; to open the document.</code></p>

<p>This calls the following JS:</p>

<pre><code>    function OpenDoc() 
    {
        &lt;%= btnSubmit.ClientID %&gt;.Visible = true; 
        Window.Open('GetDocument.aspx') 
    }
</code></pre>

<p>Unfortunately, instead of rending the JS as "btnSubmit.Visible = true" it comes out as "MainContent_btnSubmit.Visible = true" which doesn't work.</p>

<p>Assuming this is the best way of doing what I want, where am I going wrong?</p>
