jQuery and ASP.NET controls visibility in code behind
<p>In my codebehind, I set the display property of an asp.net control to none as follows;</p>

<pre><code>fuDoc.Attributes("style") = "display:none;" 'fuDoc is a FileUpload control. 
</code></pre>

<p>On my page, if the user wants to upload a document, they click on a link, which by using jQuery, I set the <code>display</code> property to <code>'block'</code> by using .show() as follows;</p>

<pre><code>$('#fuDoc').show();
</code></pre>

<p>I also tried;</p>

<pre><code>$('#fuDoc').attr('style', 'display:block;');
</code></pre>

<p>now, on form submit, I need to check if the <code>fuDoc</code> is <code>visible</code> and if so, do the standard file upload process e.g. check <code>.HasFile</code> etc..</p>

<p>However, although the fuDoc control is set to <code>display:block</code> in HTML with no problem, the following asp.net code always produces True</p>

<pre><code>If fuDoc.Attributes("style") = "display:none;" Then 'always results to true
</code></pre>

<p>What is the reason for this? Any help would be appreciated. </p>

<p>Note: the FileUpload control is NOT created dynamically. </p>
