如何在 ASP .NET 应用程序中编辑现有的 MembershipUser
我在我的应用程序中使用 ASP.NET 成员身份和角色 我想知道是否有一种干净而明确的方法来编辑现有用户
,现在我知道我可以使用
Membership.UpdateUser(MembershipUser user);
,但我猜有一个内置的 UI 控件可以为我做到这一点 就像 CreateuserWizard 仅用于编辑当前登录的用户
有什么想法吗?
提前致谢 埃兰。
i'm using ASP.NET Membership and Roles with in my application
i was wondering if there was a clean and explicit way to edit an existing user
now i know i could use the
Membership.UpdateUser(MembershipUser user);
but i'm guessing there's a built in UI control which does this for me
like the CreateuserWizard only for editing the currently logged in user
any ideas ?
thanks in advance
eran.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以重新模板化 Wizard 控件以适合您的更新属性,但您仍然需要手动更新用户。更新当前登录的用户很容易,因为您可以使用 Membership.GetUser() 方法获取当前用户,然后在代码中更改其详细信息。 (如果您不将用户传递给
GetUser()
方法,它将尝试检索当前用户)。You could re-template a Wizard control to suit your update properties, but you'll still have to manually update the user. It's easy to just update the currently logged in user since you can use the Membership.GetUser() method to get the current user and then change their details in code. (If you don't pass a user into the
GetUser()
method, it will try and retrieve the current user).没有“eran otzer”,没有由 asp.net 提供的用于更新用户的内置 UI。但你可以按照“keyboardP”所说的那样制作你的其中之一。
No "eran otzer" there is no built in UI for updating an user, provided by asp.net. But you can make one of your as said by "keyboardP".
您需要做的就是使用 Membership.GetUser 方法,用用户的属性填充表单,允许修改它们,并有一个 SUBMIT 按钮,您可以在其中调用 Membership.UpdateUser 方法。没有内置控件可以做到这一点,但实施一个应该是微不足道的。
All you need to do is use Membership.GetUser method, populate a form with the user's properties, allow them to be modified, and have a SUBMIT button where you call the Membership.UpdateUser method. There is no built-in control that does this, but implementing one should prove trivial.