rolemanager ではなく mvc メンバーシップで作成されたアプリケーションを使用していますが、それに aspx ページを追加しており、mvc アプリに付属している既存のメンバーシップを使用したいと考えています。aspx ページでロールのリストを取得するにはどうすればよいですか? そして、すべてのユーザーのリスト? 前もって感謝します。
rolemanger aspx シナリオでは、Membership.GetAllUsers() AND Roles.GetAllRoles() を使用しますが、mvc では機能しません。aspxで動作するにはこれが必要です
Imports Nop.Core.Infrastructure
Imports Nop.Services.Helpers
Imports Nop.Core.Domain.Customers
Imports Nop.Services.Customers
Imports Nop.Core
ListBox1.DataSource = EngineContext.Current.Resolve(Of IWorkContext)().CurrentCustomer.CustomerRoles()
ListBox1.DataBind()
'this is the listbox on aspx page
<asp:ListBox ID="ListBox1" runat="server"></asp:ListBox>
これは、各ロールのユーザーごとに複数のロールがある場合に繰り返されるリストボックスの出力です。
System.Data.Entity.DynamicProxies.CustomerRole_6E0DFC682B2D3247B3BEEED3063345A95D5742CE33B2761C4CB20A8C0A0AD639