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

Controlling RadMenuItem visibility with inline code

1 Answer 157 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Wayne Ross
Top achievements
Rank 1
Wayne Ross asked on 13 Apr 2011, 04:58 PM
I seem to be having a problem controlling the visibility of a RadMenuItem using inline code. I have an "Admins Only" dropdown I want to display only if a session variable test is true. I swear this used to work, but as of 2010Q3 it is not. The sample line is:

<telerik:RadMenuItem runat="server" Text="Admin" Visible='<%# iif(session("UserID") = "1", "True", "False") %>'>


The page loads up fine, but no matter the content of the session variable (empty, "1", "2", nothing), the menu is always displayed.

Any suggestions?

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 18 Apr 2011, 12:13 PM
Hello Wayne,

For the inline server code to execute you need to call RadMenu's DataBind() method. Other than that, I tested the case but everything seemed to work as expected. Attached is a simple demo for reference.

Let me know if I am missing something.

Best wishes,
Peter
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Menu
Asked by
Wayne Ross
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or