62,074
社区成员
发帖
与我相关
我的任务
分享
[Authorize(Roles = "Manager")]
public ActionResult Index()
{
return View(MembershipService.ListUsers());
}
[Authorize(Roles = "Manager")]
public ActionResult Delete(string userName)
{
MembershipService.DeleteUser(userName);
return RedirectToAction("Index");
}
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%
if (Request.IsAuthenticated) {
%>
欢迎您: <b><%= Html.Encode(Page.User.Identity.Name) %></b>
[ <%= Html.ActionLink("注销", "LogOff", "Account") %> ]
[ <%= Html.ActionLink("修改密码", "ChangePassword", "Account")%> ]
<%
}
else {
%>
[ <%= Html.ActionLink("登录", "LogOn", "Account") %> ]
<%
}
%>