i'm building first asp.net web application. i've gotten pretty far, i'm confused built-in account features.
i created own database, got set using aspnet_regsql tool, set membership , role providers in web.config, , seems working great. can create new accounts, log in, etc. in trying add roles, found lot of older articles , think i've got confusing mix of new , old information now.
basically, trying list of user accounts can edit them , assign roles. seems membership.getallusers looks in table called aspnet_users, login accounts in aspnetusers. result, getallusers returns nothing.
after couple hours of internet searching, i'm still not sure do. how can use built-in tools set user roles, can restrict access pages?
edit: found documentation on applicationusermanager , rolemanager owin identity framework. think i'm on right track, i'm still stuck trying list of users.
i did it! lists of users , roles in new asp.net identity framework (version 2.0) can accessed this, , data stored in aspnetusers , aspnetroles tables.
protected sub binduserstouserlist() dim manager new usermanager(of applicationuser)(new userstore(of applicationuser)(new applicationdbcontext)) userlist.datasource = manager.users.tolist userlist.databind() end sub protected sub bindrolestolist() dim rm new rolemanager(of identityrole)(new rolestore(of identityrole)(new applicationdbcontext)) usersrolelist.datasource = rm.roles.select(function(q) q.name).tolist usersrolelist.databind() end sub
Comments
Post a Comment