Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP.NET (http://www.programmingforums.org/forum35.html)
-   -   ASP.Net Login Control (http://www.programmingforums.org/showthread.php?t=14507)

Ghost Nov 18th, 2007 1:36 PM

ASP.Net Login Control
 
Info for the control can be found here. But that isn't the point of this thread.

I was wondering how many people us it, vs making your own login system. To me it seems making your own would allow for a lot more control, yet I've never used the login control enough to know what it can do.

xavier Nov 18th, 2007 10:52 PM

Re: ASP.Net Login Control
 
I have used the Membership system in ASP.NET on several occasions and i can say that is very customizable.

First you can create a custom provider just by specifying in the web.config file things like : what database to use, if the email should be unique, what length the password , if you want sliding expiration or not ... etc.

Then if you want even more control, you can derive from the MembershipProvider class and override methods like ValidateUser ..

I think I have at work some good links for this but I doubt it's something google couldn't answer .

As for needing a custom control , I guess that's always an option depending on the requirements.

PS: for installing the membership tables, there is a command line tool that can do that but on cool class it took me a while to find out about is :
:

  1. System.Web.Management.SqlServices.Install("server", "USERNAME", "PASSWORD", "databasename", SqlFeatures.All).


Ghost Nov 19th, 2007 2:11 AM

Re: ASP.Net Login Control
 
Xavier, awesome post. Very helpful, i might just make a demo db and play with it now. I didnt know it had all that.

Any other tips or tricks you know of?

xavier Nov 19th, 2007 3:32 AM

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 :

:

  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.

Ghost Nov 29th, 2007 6:52 AM

Re: ASP.Net Login Control
 
Xavier, I'm having a little issue creating a custom Provider, basically getting the ASP.NET Web Site Administration Tool to read and be able to connect to a remote MS SQL Database. I have been having trouble locating any site that guides me or provides me with the missing information to complete this task.

If you know of any resourses that'd be great, I'd like to start using and learning how to use this old yet amazing part of the framework. Thank you.

xavier Nov 29th, 2007 12:17 PM

Re: ASP.Net Login Control
 
How's your web.config looking like ?


All times are GMT -5. The time now is 8:14 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC