This is a migrated thread and some comments may be shown as answers.

Show/Hide Server-Side equivalent

1 Answer 105 Views
Menu
This is a migrated thread and some comments may be shown as answers.
[Nean]
Top achievements
Rank 1
[Nean] asked on 25 Jun 2009, 09:04 AM
Hi,

I was wondering what does really do the show/hide method client-side on a menuitem. It doesn't seem to put visibility to "false" neither to put display to "none" because when I put one of those properties server-side, when i use the show method client-side, it doesn't work.

Is there an equivalent server-side for the show/hide method on menuitem ? I want to initialize the menuitems visibles server-side, and then client-side i want to show/hide menuitems depending on what the client is doing. The client-side part works perfectly, but i can't initialize server-side like I want.

If anyone can explain to me how I can do the similar action than show/hide but server-side...

Regards,

[Nean]

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Jun 2009, 01:57 PM
Hi Nean,

One suggestion toggling the display style setting between none and block for the radmenuitem from server side and client-side in order to hide/show the item. Give a try with this.

CS:
 
RadMenu1.FindItemByText("Root RadMenuItem1").Style.Add("display""block"); // Show the item

JavaScript:
 
<script type="text/javascript">  
function Visibility()  
{  
    var menu = $find("<%= RadMenu1.ClientID %>");  
    var item = menu.findItemByText("Root RadMenuItem1");  
    item.get_element().style.cssText = "display: none;";  // Hide the item
}  
</script> 

Thanks,
Princy
Tags
Menu
Asked by
[Nean]
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or