How to enable/disable menu item LI [Resolved]

Posted by Krishnasamy2008 under ASP.NET MVC on 3/4/2016 | Points: 10 | Views : 778 | Status : [Member] | Replies : 1
Hi,

I want to disable/enable menu item li based on boolean attribute which is stored in hidden field using mvc application.Below example i want to disable department & admin if userrole is user.I want to enable employee if user roles is super user.

example:
<ul id="panelbar" class="panelbar hidden"><li id="parentLI"><a class="current" href="/Emp/EmpUserProfile" id="909" rel="909">Employee</a></li><li id="parentLI"><a class="" href="/Emp/EmpUserProfile" id="910 rel="910">Department</a></li><li id="parentLI"><a class="" href="/Emp/EmpUserProfile" id="910" rel="910">Admin</a></li></ul>

Kindly share me example using jquery or javascript.

Thanks,
Krishna.K




Responses

Posted by: Rajnilari2015 on: 3/5/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
@Krishnasamy2008 Sir, you can use JQuery's Hide and Show method

Please refer to Techfunda's example for the same

http://techfunda.com/howto/381/hide-hide-particular-element

http://techfunda.com/howto/383/show-show-element

Let us know your progress.

Hope that helps

--
Thanks & Regards,
RNA Team

Krishnasamy2008, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response