Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a login/registration application 1

Status
Not open for further replies.

Glasgow

IS-IT--Management
Jul 30, 2001
1,669
GB
Hi, my experience is primarily with Classic ASP but I need to bite the bullet and move to ASP.NET.

What I'd like to do partly as a training exercise is write a small web application that allows login / registration and recording of name, address, email etc. I'd also like to communicate with a MySQL database rather than SQL 2005 / 2008.

I'm aware of the fact that .NET 2.0 offers a login control and other related features but I really would prefer to get into the guts rather than have the job done for me. Also, I know there are issues surrounding the capture of additional data with the control and as I am intending to capture such data, I'd prefer to avoid those issues.

Can anyone point me at some relevant code (e.g. connecting with and reading a MySQL database & table) and/or articles that could get me started on this?

Thanks in advance.
 
asp.net an http framework. on top of asp.net you have a number of frameworks that can handle requests and generate html. in no particular order
Webforms
MS MVC
Castle Monorail
FUBU MVC

there may be others but these are the big 4.

Unfortunately Webforms is the default html engine for asp.net. Don't bother with it. It takes 2 simple concepts (html, http) and makes them complicated. When .net was first introduced webforms was your only choice. and webforms and asp.net became synonymous. but they are very different.

MS MVC is headed in the right direction and has most of the features that Monorail has. Monorail has been around much longer and is more mature.

FUBU MVC is brand new and headed up by the guys at Dovetail. This framework favors Convention over Configuration and requires a strong background in OOP/SOLID principles for effective use.

All this deals with managing the control of requests. there is still the issue of rendering the html.

MS MVC, Monorail and FUBU all allow you to select your html engine of choice. Spark is great. period. other options are AspView, Webforms (but not the webforms mentioned above), NVelocity, Brail...

None of this has to do with the example you stated above, but this gets at more of the core building blocks of asp.net development.

with authentication you are dealing with IPrinciple and IIdentity implemenations along with asp.net authentication. Forms authentication in this case.

wanting to connect to a database you have some options there.
ADO.net
NHibernate
ActiveRecord
MS DataAccess Block
LLBL Gen Pro
Entity Framework 4.0 (POCOs finally!)

ADO.Net is the core building blocks to database access. all the other frameworks I mentioned are built on top of ado.net. NHibernate, ActiveRecord, LLBL & Entity Framework are frameworks built around the concept of Object Relational Mapping (ORM). NHibernate and LLBL are biggest names. Entity Framework will catch on strong because it's an MS framework.

MS DataAccess Block works works more with stored procedures and DataSets, rather than domain object models. The other frameworks above can handle procs as well, but it's not the primary method to generate sql.

So, I just threw alot of frameworks and building blocks at you:) You probably have more questions than answers at this point. So ask away:) I think your best bet at this point is to create a simple "hello world" website. then add database access. then add security.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
You probably have more questions than answers at this point
Well I have now! Thanks for your "beyond the call of duty" level of input.

I have dabbled a bit with webforms and the login control and other "easy" stuff to the extent that I've populated datagrids from a SQL database and so I could probably be deemed to have qualified at the "hello world" level. Your comments on winforms surprise me (i.e. don't bother) but I do feel that I have been a victim too many times of something that Microsoft claims to solve all problems but rarely does and I end up re-inventing the wheel so it works the way I want it to.

I confess I was not even aware of MS MVC etc as concepts so I need to investigate them.

At the moment I'm trying to achieve results at a very raw root level. I have set up a simple page that connects to a remote MySQL database using Odbc connection and ADO.NET. I will probably stick with ADO.Net for the moment although that's also a learning curve and, having populated a dataset and bound a grid to it, I'm now investigating how best to achieve other very fundamental goals like...

a) looking up a supplied key in the database.
b) updating that record
c) inserting a record etc..

but I accept that this is pretty much ADO.NET 101 stuff and I should be able to find out for myself but you'd be surprised how long it took for me to come up with the code to connect to MySQL - even though it was only about a dozen lines in the end. I could do the ADO equivalent in my sleep but the only similarity with ADO.NET seems to be in the name!
 
yeah, I've burned on MS frameworks and P&P myself. I avoid them most of time. With every framework MS puts out there is usually OSS which is more mature and stable.

MS MVC -> Monorail (FUBU, although it's newer)
Entity Framework -> NHibernate, ActiveRecord, LLBL ($)
MS Test -> nUnit & MbUnit
Unity -> Windsor, StructureMap, Ninject, AutoFac
MS AJAX -> jquery
...

as for database access in a web context. see the FAQ below in my signature. This uses raw ado.net objects. Again, if you have questions, please ask.



Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Thanks Jason. I hope to get back to this on Monday. Have a good weekend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top