Label won't show when label hidden via page load
<p>The desired effect is that on page load the label does not display but when the user clicks the check box the label displays.  This small code sample is just a sample to illustrate the issue.  The code will always return an object reference exception from javascript when the Visible property of the label is set to false.  If that line is commented out, it will execute correctly with no object reference exceptions but the label should be hidden at page load.  This application does use master pages which is why were are passing the ClientIDs to the javascript Toggle function.</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    this.chkSelect.Attributes.Add("onClick", "Toggle('" + this.lblAdd.ClientID + "', '" + this.chkSelect.ClientID + "')");
    this.lblAdd.Visible = false;
}

&lt;script type="text/javascript"&gt;
    function Toggle(lblAdd, chk) {
        var ctrlAdd = document.getElementById(lblAdd);
        var ctrlChk = document.getElementById(chk);

        if (ctrlChk.checked == true) {
            ctrlAdd.style.display = 'inline';
        }
        else {
            ctrlAdd.style.display = 'none';
        }
    }
&lt;/script&gt;


    &lt;asp:Label ID="lblAdd" runat="server" Text="Add" Font-Size="8pt" ForeColor="Blue"&gt; &lt;/asp:Label&gt;
    &lt;asp:CheckBox ID="chkSelect" runat="server" Text="Check Box1" /&gt;&lt;br /&gt;
</code></pre>

<p>How can we hide that label in Page_Load so we don't get object reference errors from Internet Explorer?</p>

<p>Thanks...</p>
