Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 18th, 2007, 1:36 PM   #1
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
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.
Ghost is offline   Reply With Quote
Old Nov 18th, 2007, 10:52 PM   #2
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

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 :
csharp Syntax (Toggle Plain Text)
  1. System.Web.Management.SqlServices.Install("server", "USERNAME", "PASSWORD", "databasename", SqlFeatures.All).
__________________
Don't take life too seriously, it's not permanent !
xavier is offline   Reply With Quote
Old Nov 19th, 2007, 2:11 AM   #3
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
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?
Ghost is offline   Reply With Quote
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
Old Nov 29th, 2007, 6:52 AM   #5
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
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.
Ghost is offline   Reply With Quote
Old Nov 29th, 2007, 12:17 PM   #6
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

How's your web.config looking like ?
__________________
Don't take life too seriously, it's not permanent !
xavier is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Login in ASP.NET Help bigguy ASP.NET 1 Nov 18th, 2007 12:36 PM
How to add inherited control to toolbox. InfoGeek C# 3 Feb 8th, 2007 9:12 PM
[IDEA] ASP.NET Web Control Panel mjhoagland Project Ideas 1 May 30th, 2006 2:54 PM
Show web user control hidden see07 C# 1 Feb 2nd, 2005 10:35 AM
how to login computers with same login and password Tiger Java 5 Jan 31st, 2005 7:53 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:29 AM.

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