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

[Solved] Nodes the require Authenticated and Non-Authenticated Users Confusion

1 Answer 88 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mpaul
Top achievements
Rank 1
mpaul asked on 20 Jul 2010, 03:12 PM
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

Sort by
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:
<% bool isAuthorized = //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
Tags
Menu
Asked by
mpaul
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or