html - enabling/disabling <a> tag through c# code -


i trying enable/disable "a" tag that's in html code through c# code. know if button use, xxx.visible="false/true" guess "a" tag not have features backend code. here have,

c#:

if (session["sessionusersloginid"] == null)     {           alreadymemberlabel.visible = true;         signinbutton.visible = true;         forgotdbutton.visible = true;         passwordlabel.visible = true;         passwordtextbox.visible = true;         right here should disable visibility "login_pop" tags     } 

html:

 <span style="width:32%; float:right;">                 <div class="panel">             <a href="#login_form" id="login_pop">log in</a>             <a href= "addusers.aspx" id="login_pop">sign up</a>          <span style="width:32%; float:right;">                          <asp:button id="forgotdbutton" cssclass="btn-link forgotpass" runat="server" height="25px" text="forgot password?"                                  onclick="forgotdbutton_click" width="135px" />                </span>          </div> 

maybe there way enable/disable through id? you

firstly, have 2 same ids on different elements (login_pop) should unique.

second, can make <a> tag server component , way can access code-behind:

html

<a href="#login_form" id="login_pop" runat="server">log in</a> 

c#

login_pop.disabled = true; 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -