Print Page | Close Window

Admin ASP.NET Membership

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1877
Printed Date: 21-Apr-2026 at 3:52pm


Topic: Admin ASP.NET Membership
Posted By: master-of-disaster
Subject: Admin ASP.NET Membership
Date Posted: 10-Jun-2010 at 4:12am
Hello,
 
I have create a Silverlight Navigation Page. Here I implement a ASP.Membership Login with DevForce.
 
Here I've to questions/problems.
 
1. How can I check with DevForce for Silverlight username, role in my HomeViewModel for example.
 
2. I need to create, change/update user account as admin. How can I get all users, roles for users and can update a profile for example??
 
Is there anyone, who can help me? Do someone have samplecode?
 
Regards
Dirk



Replies:
Posted By: ting
Date Posted: 14-Jun-2010 at 7:02pm
Hi Dirk,
 
The current user is available from the Entitymanager.Principal property.  This returns a UserBase from which you can call UserBase.Roles or UserBase.IsInRole().
 
For user administration, I believe you just use the Microsoft ASP.NET Security API and tools.
 
Our documentation for this is in Learning Resources -> Security, and there are three code samples there as well that you can take a look at.
 


Posted By: master-of-disaster
Date Posted: 16-Jun-2010 at 12:35pm
Hello,
 
thank you, for your information. It was the information, to create a login.
 
But I've build a standard SL navigation application. Here I've implement DevForce Silverlight to create a login with DevForce Silverlight and ASP.NET Membership and handle my dataoperations.
 
On my main page I use a EntityManager.Principal property. It works fine to return a UserBase information like IsAuthenticed or username for example in my main page. The navigation menu to show a navigation page can be restrickted as expected.
 
But how can I route EntityManager.Principal property  to check user IsInRole() to my navigationpage?
 
Here I will create a Dashboard, here I need to check user roles to enable/disable buttons and other xaml elements for example.
 
When I try to set in main page datacontext => this.ContentFrame.DataContext = user after Login, in my navigation page are no user context is routed.
 
 
Regards
Dirk


Posted By: master-of-disaster
Date Posted: 25-Jun-2010 at 2:33am

I've found a way. I use Globals.cs in my SL-Project to sent dataContext of user to my navigation page.

Regards Dirk



Print Page | Close Window