jquery and html elements that run at server
<p>I have a  element contained in a user control (header). This div includes sub divs inside it. One of them includes user options. The user options div () displays the username of the logged in user, and couple of links related to already signed in users such as logout, settings etc.. the "user_options" div is absolutely positioned within the "header" div.</p>

<p>Now, in the login page itself, I want to hide this div since the user is taken there because she/he is not logged in. In this case, I put a runat="server" attribute to the "user_options" div and I carry a check in page_load event of the .aspx page to see is the user is logged in as follows;</p>

<pre><code>if check_user_loggedin() then
  user_options.attributes("style") = "display:none;"
  ' also tried this with user_options.visible = false and 
else
  user_options.attributes("style") = "display:block;" 
  ' in this one, I even tried the whole positioning css e.g. display:block; positon:absolute; left:100px; etc...
end if
</code></pre>

<p>now with this code, when I run the project, it works fine where I do not want to display the div - it gets hidden successfully. But in those pages where I need to show the div, it still gets displayed at the far top left side of the page, and the jquery click event of other "div" elements inside it also don't work.</p>

<p>I presume it has something to the with the execution order or the page event cycle but can you suggest any workaround for this?</p>

<p>========= EDIT ========================= <br/>
THIS IS THE CSS:</p>

<pre><code>   #user_options
    {
        position:absolute;
        top:18px;
        right:10px;
        width:200px;
        color:#ffffff;
        text-align:right;
    }
</code></pre>

<p>THIS IS THE HTML:</p>

<pre><code>&lt;div id="user_options" **runat="server"**&gt;
    &lt;strong&gt;&lt;a class="whiteLink" href="#"&gt;&lt;%=MyNamespace.Users.getUsernameFromCookie%&gt;&lt;/a&gt;&lt;/strong&gt; | &lt;a class="whiteLink" href="usr_logout.aspx"&gt;logout&lt;/a&gt; | &lt;a class="whiteLink" href="#"&gt;settings&lt;/a&gt; | &lt;a class="whiteLink" href="#"&gt;help&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>THIS IS THE CODE IN USER CONTROL:</p>

<pre><code>Private _displayUserOptions As Boolean
Public Property displayUserOptions() As Boolean
    Get
        Return _displayUserOptions
    End Get
    Set(ByVal value As Boolean)
        _displayUserOptions = value
    End Set
End Property


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If displayUserOptions Then
        user_options.Attributes("style") = "display:none;"
    Else
        user_options.Attributes("style") = "display:block;"
    End If
End Sub
</code></pre>

<p>THIS IS WHAT I CALL IN THE HTML PAGE TO DISPLAY THE USER CONTROL</p>

<pre><code>&lt;uc1:x_layout_top ID="x_layout_top1" runat="server" displayUserOptions="false" /&gt;
</code></pre>
