我在使用 LoginView 来满足我的需要时遇到问题。有人可以告诉我是否可以在 LoginView 中执行此操作(以及如何),或者我是否需要使用代码隐藏。
我有两个角色 - 管理员和用户。我想根据角色动态显示链接。我将在 if 语句中写出我想要的内容,因为它更容易解释:
if (role = Administrator) //Display only if administrator.
Show Hyperlink 1
Show Hyperlink 2
else
if (role = User) //Display only if user.
Show Hyperlink 3
Show Hyperlink 4
endif
//Display these if a user or if non-authenticated user...
Show Hyperlink 5
Show Hyperlink 6
Show Hyperlink 7
endif