Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've created a menu by using ul li tags

XML
<ul >


  <li><a href="KarEditMyProfile.aspx">aa</a>
  </li>


  <li ><a  href="KarPhoneSearch.aspx">bb</a>

  <ul class="sub-menu">
    <li "><a href="KarAddPhone.aspx">bbbb</a></li>
  </ul>

</li>


  <li><a href="Karbar.aspx">cc</a>
  </li>

</ul>




I need to disable ---- > href="/KB/answers/KarAddPhone.aspx" "

How can I do it ?!
Posted
Comments
Manas Bhardwaj 20-Apr-14 7:18am    
Always disable or based on certain conditions?
marimir 20-Apr-14 7:22am    
No based on a condition which is defined in behind code

Try the menu item's disabled property[^].

If you use JQuery, you can try something like
$(this).closest('ul').find('input:button').attr('disabled', 'disabled');
 
Share this answer
 
I've found the solution ...
the html code would be this :

XML
<ul >


  <li><a href="KarEditMyProfile.aspx">aa</a>
  </li>


  <li ><a  href="KarPhoneSearch.aspx">bb</a>

  <ul class="sub-menu">
    <li "><a href="KarAddPhone.aspx" id="HRef_Add" runat="server">bbbb</a></li>
  </ul>

</li>


  <li><a href="Karbar.aspx">cc</a>
  </li>

</ul>





and in code behind write this :

HRef_Add.Visible = false ;


it works for me
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900