In my codebehind, I set the display property of an asp.net control to none as follows;
fuDoc.Attributes("style") = "display:none;" 'fuDoc is a FileUpload control.
On my page, if the user wants to upload a document, they click on a link, which by using jQuery, I set the display property to 'block' by using .show() as follows;
$('#fuDoc').show();
I also tried;
$('#fuDoc').attr('style', 'display:block;');
now, on form submit, I need to check if the fuDoc is visible and if so, do the standard file upload process e.g. check .HasFile etc..
However, although the fuDoc control is set to display:block in HTML with no problem, the following asp.net code always produces True
If fuDoc.Attributes("style") = "display:none;" Then 'always results to true
What is the reason for this? Any help would be appreciated.
Note: the FileUpload control is NOT created dynamically.