c# - How to hide specific jqueryui tab based on some condition? -
i working on application in selected tab should not visible specific users.my code is
<div id="tabs"> <ul> <li><a href="#divlogtickets">log tickets</a></li> <li><a href="#divopentickets">open tickets</a></li> </ul> <div id="divlogtickets" runat="server" style="padding: 25px;"> </div> </div> if (getuserrole(convert.tostring(session["userid"])) == "hr") { //hide tab }
how hide specific tab based on specific user role.
you can add id
, runat="server"
attributes elements want access code behind , set .visible
property in code behind.
for example if want hide log tickets
tab, here's aspx code should like:
<div id="tabs"> <ul> <li id="lilogtickets" runat="server"><a href="#divlogtickets">log tickets</a></li> <li><a href="#divopentickets">open tickets</a></li> </ul> <div id="divlogtickets" runat="server" style="padding: 25px;"> </div> </div>
then set visibility of lilogtickets
, divlogtickets
in code behind:
if (getuserrole(convert.tostring(session["userid"])) == "hr") { //hide log tickets tab lilogtickets.visible = false; divlogtickets.visible = false; }
Comments
Post a Comment