Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 17th, 2013, 01:07 PM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Binding tables from database with Login Control

hi everyone,

I am following the Beginning ASP.NET 4 which is a fantastic edition with clear and complete example of building a full featured website...
However when it comes to login controls i get stuck as the book provides a good example of how to create the whole login system but it does not provide an example of how to bind the login control with a table in database "Preferably with SQL SERVER" so here is my situation:
I want my login control to interact with a login table in database pre-loaded with users names and passwords so when a user logs in it should check the user details against the details in DB...!
I would really appreciate if someone could help me with this and if possible provides an example...

Thanks
Reply With Quote
  #2 (permalink)  
Old March 19th, 2013, 10:47 AM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Do you mean you don't want to use Membership but your own authentication mechanism? I would recommend against that, but if you have compelling reasons to do so, you can handle the control's LoggingIn event, do your own user validation and then set e.Cancel to to true. But this would also require you make sure the user remains authenticated by the use of a cookie or a session variable.

Some useful links:

http://msdn.microsoft.com/en-us/libr...loggingin.aspx

https://www.google.com/#hl=nl&sclien...w=1920&bih=931

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old March 19th, 2013, 11:05 AM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default appreciation:

Dear Imar:

First of all : Thank you so much by replying to my query...
Secondly : Thanks you so much for providing such a simple, understandable books which is really motivating even people who are no very interested with IT specially programming or web development...

Regarding my previous post:
I am working on a project where i am uploading a list of people to database table where i have to provide them with initial login id and password which i have done all of these through my own validation etc... but when it come to security i was not sure if that was the right way but when you mentioned you will not recommend it then it means it is weak so :
is there a way if i could configure the already built in controls and provide my users initial login details? An example would really help me

Thanks
Reply With Quote
  #4 (permalink)  
Old March 19th, 2013, 11:12 AM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Is it an option to create the users in the Membership system? That would be the quickest and safest way to do i. Building your own login system has risks involved, that are typically already covered with the built-in Membership system.

You can create a user using the Membership API like this:

Code:
Membership.CreateUser("UserName", "Password")
Quote:
Thanks you so much for providing such a simple, understandable books which is really motivating even people who are no very interested with IT specially programming or web development...
You're welcome. Good to hear you like the book so much.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Binding from many Tables to Gridview khoder ASP.NET 2.0 Professional 1 February 19th, 2007 10:22 AM
Connecting the Login Control to a Custom Database? WayTooAwesome ASP.NET 2.0 Basics 3 July 5th, 2006 03:31 PM
Binding TextBox from 3 Tables melvik C# 0 July 6th, 2003 02:51 AM



All times are GMT -4. The time now is 12:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.