I'm binding the menu to a sitemap and I have two nodes, Login and Logout. I want Login to show for non-authenticated users and logout to show for authenticated users. How should I handle this?
Thanks!
1 Answer, 1 is accepted
0
Georgi Krustev
Telerik team
answered on 20 Jul 2010, 05:26 PM
Hello mpaul,
You need to determine whether the currently user is authorized or not and depending on the given information to show or hide menu items:
<% boolisAuthorized = //determine when the user is authorized. %>
<%= Html.Telerik().Menu()
.Name("Menu")
.BindTo("test", (item, node) => {
item.Visible = isAuthorized;
})
%>
Sincerely yours,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items