View Single Post
Old Nov 19th, 2007, 3:32 AM   #4
xavier
Professional Programmer
 
xavier's Avatar
 
Join Date: Oct 2004
Location: .ro
Posts: 383
Rep Power: 4 xavier is on a distinguished road
Send a message via Yahoo to xavier
Re: ASP.Net Login Control

And I was only talking about the Membership feature but you can have Roles and Profile for users.

Roles is quite a nice feature , it allows you to have something like this:
<asp:LoginView runat="server" ID="mainLoginView" OnPreRender="mainLoginView_PreRender">
                                    <AnonymousTemplate>
something for anonymous users
                                    </AnonymousTemplate>
                                    <RoleGroups>
                                        <asp:RoleGroup Roles="Administrator">
                                            <ContentTemplate>
.. something for administrators
                                            </ContentTemplate>
                                        </asp:RoleGroup>
                                        <asp:RoleGroup Roles="Operator">
                                            <ContentTemplate>
... something for the operators
                                             </ContentTemplate>
                                        </asp:RoleGroup>

But it will come a point in time when you want to customize the create user control. Now that's ok, not that hard . But when you want to get the value of another control (let's say you put a dropdownlist) you have to do this :

csharp Syntax (Toggle Plain Text)
  1. CreateUserWizardStep cUserStep = (CreateUserWizardStep)CreateUserWizard1.WizardSteps[0];
  2. DropDownList ddlToBind = (DropDownList)cUserStep.ContentTemplateContainer.FindControl("RolesListDdl");

And let's just say it wasn't the first thing that came to my mind.
__________________
Don't take life too seriously, it's not permanent !
xavier is offline   Reply With Quote