Click here to Skip to main content
11,410,750 members (62,111 online)
Click here to Skip to main content

Login System (ASP.NET)

, 9 Sep 2004
Rate this:
Please Sign up or sign in to vote.
This is basically a Login system in ASP.NET using and javascript,ODBC using DSN method.This is my first code in I am new to ASP.NET.


Download sourcecode

Login System (ASP.NET)

This is basically a Login system in ASP.NET using and JavaScript.
I searched lots of site for "DSN" connectivity in But I couldn’t find a single site .So I feel to share this article or code among the developers.
I have used ODBC "DSN” method to connect with database.
And for validation I have used JavaScript, so the beginner in ASP.Net can learn how to use JavaScript in ASP.NET.
As I am new to ASP.NET, if you feel to leave any comment please.

This is my first article on login system in

  • What it does?
    This is an login system in using you can redirect a registered user to the protected area of your website.
  • Simple to integrate with your existing system
    This is very simple code. You can easily integrate wiht your existing .net site.
    You have to include this file in to your existing code or the file where you want to make login area.
    Database: For database you have to create a table in to your existing or new database call " tblAdmin"
  • Structure of the database
    FieldsName    Datatype
    sno          autonumber
    username          text
    pwd                  text

    After verifying the password you can easily redirect the user to the protected area of your website by modifying
    the redirect option in the file.
    You can also check the user if the user is logged in or not by session("whois"). If the value of this variable is blank then you can again redirect the user for login page.

The most important part of the code is DSN connectivity and Javascript to validate the form. I have searched lots of site about the DSN connectivity in ASP.Net but I couldn't find a single site on DSN method.
I have tried my own skills and get this code. So I want to share this article or code with other programmers who are looking for some information on DSN connectivity in and javascript using in

As I said earlier I am new to If there are any bugs or suggestions for improvements please let me know.I have updated this to prevent from "Sql Injections"

Login System in ASP.NET by Vipin Sharma. Visit me at

Vipin Sharma.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
India India
I specialise in the design and development of Internet and Intranet applications on Windows 2000
and Windows NT. The main tools and technologies I use are: Visual InterDev, FrontPage,HTML
Dreamweaver Active Server Pages (VBScript and JScript),Java Server Pages, JavaScript,
Visual Basic 6, Component Object Model (COM),DCOM SQL Server 7.0, ADO, Access 97, Oracle8i
Index Server,Visual Interdev 6.0.
I also have some experience in web development on WindowsNT and Access,Oracle.

Comments and Discussions

GeneralMy vote of 1 PinmemberMarco Bertschi6-Feb-13 5:16 
GeneralMy vote of 1 PinmemberTANicox25-Feb-12 6:45 
GeneralMy vote of 5 Pinmemberprabhu1718-Jul-11 3:32 
Questionhow do you configure a mysql server PinmemberKatamba Raymond12-Feb-11 8:49 
GeneralMy vote of 1 PinmemberATUL DHIMAN26-Oct-10 23:18 
GeneralMy vote of 1 Pinmemberjeganssnit5-Aug-10 20:04 
GeneralDSN info PinmemberMr Pack17-Jul-07 5:51 
GeneralLittle but very good for beginners PinmemberTahir Naeem16-Mar-05 2:05 
GeneralNot Secure - SQL Injection Attacks PinmemberMichael W.10-Sep-04 6:38 
GeneralRe: Not Secure - SQL Injection Attacks Pinmembervipinsharma10-Sep-04 21:20 
GeneralRe: Not Secure - SQL Injection Attacks PinmemberMichael W.11-Sep-04 5:30 
GeneralRe: Not Secure - SQL Injection Attacks PinmemberColin Angus Mackay27-Sep-04 11:17 
GeneralLow votes PinsitebuilderPaul Watson9-Sep-04 22:38 
GeneralRe: Low votes Pinmembervipinsharma9-Sep-04 23:31 
GeneralRe: Low votes PinmemberWillemM10-Sep-04 4:38 
GeneralRe: Low votes PinmemberColin Angus Mackay10-Sep-04 10:36 
GeneralRe: Low votes Pinmembervipinsharma10-Sep-04 20:44 
GeneralRe: Low votes PinmemberColin Angus Mackay10-Sep-04 23:38 
GeneralMore work needs done. PinmemberColin Angus Mackay11-Sep-04 4:56 
Okay.... It is, at least, a wee bit better.

Some formatting issues first. The download link should go at the top like all the other articles on Code Project, there is a template you can download.

The red headings should be replaced with <h2> or <h3> tags. The colour red is very strong and has a very specific connotation on text dominant web pages - it denotes something that is wrong, and error to be fixed, or a piece of information that absolutely must be read.

Also, try and find some more things to say about your code, the article is still quite short. Paste some relevant code into the article, and show exactly how the code is working from within the article. Wrap any code in <pre> tags so that the Code Project formatting engine will colour the code properly. (But remember do not paste code greater than 60 characters per line, split the lines if necessary)

Hopefully, in the next iteration your article will be much better.

"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150414.5 | Last Updated 10 Sep 2004
Article Copyright 2004 by vipinsharma
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid