.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Login Form

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net


I trying to figure out how to create a login 'system' for my website.

I know there is the default Login Control but I seem unable to link it to my custom database.
Also I want to know how to write my own rather than using default codes, as to learn more.

My question is how should I go about doing this?

- Should I use Sessions? (if so how much space does this requite per user on the server?)
- Should I use a stored procedure for the login procedure? ( I know how to create Stored Procedures, working on outputting the data now )
- How should I 'save' the users state? as I have a value in the database stating whether he is one of the following: (banned, not_activated, user, admin, etc. not_activated would only happen after first login where it prompts the user for a activation code after which he/she is converted to a user).
- How should I go about the 'remember me' part?

Examples/Tutorials would be welcome.

I use ASP.net4 with C#

Thanks for the help in advanced

View Complete Post

More Related Resource Links

Windows authentication login form issue


Hi guys,

I have an application that requires windows authentication to login, the problem is that every time an user logs in under IE and win XP, the username is pre filled with the IP address of the server as instance and the username. I need to replace the server ip with  XXXX instance name instead of doing this manually.

Could anyone pleas help me out with this one?

Thanks in advance,


how do i create a windows form application login for to validate username and password from sql serv

 I would like to know how I can create a login form for my windows form application. The login form must be linked to a SQL server 2005 express edition database (in which the username and passwords are stored). The login form must validate the user using the database and allow them to access the program. 

HttpWebRequest Form Authentication Not Getting Past Login Page

Hey Guys,I am trying to use HTTPWebRequest to login to a site and then retrieve the page after login. However, it seems as if I can't get past the login. I also investigated with Fiddler and tried mimicking Fiddler almost completely and still no luck.Any idea what I am doing wrong?Thanks,Mohammed    Dim webRequest As HttpWebRequest Dim responseReader As StreamReader Dim responseData As String Dim postData As String = "login=testexpert@yahoo.com&password=testexpert" Dim cookies As CookieContainer = New CookieContainer() Dim requestWriter As StreamWriter Try 'post form data to page strUrl = "https://www.ideeli.com/login" webRequest = HttpWebRequest.Create(strUrl) webRequest.Method = WebRequestMethods.Http.Post webRequest.ContentType = "application/x-www-form-urlencoded" webRequest.CookieContainer = cookies webRequest.ContentLength = postData.Length requestWriter = New StreamWriter(webRequest.GetRequestStream) requestWriter.Write(postData) requestWriter.Close() 'recieve cookie webRequest.GetResponse().Close() 'now we send the cookie webRequest = HttpWebRequest.Create("http://www.ideeli.com") webRequest.CookieContainer = cookies responseReader = New StreamReader(webRequest.GetResponse.GetResponseStream()) responseData = responseReader.ReadToEnd() res

Form based authentication Sharepoint 2007 gets redirected to login page

Hi We have sharepoint 2007 site deployed on Windows server 2008, IIS 7.0.  We extended the web application to enable forms based authentication referring to link http://msdn.microsoft.com/en-us/library/bb975136(office.12).aspx#MOSS2007FBAPart1_Intro, we selected Kerberos instead of NTLM, behavior is like, when user tries to login into the site using OOB login.aspx, user again gets redirected to the login page. We tried to extend the web application again but this time we selected NTLM, but this time farm account (also is application pool identity) is not able login and exhibits same behavior as above, but for other users we are able to login. Has anyone come across this behavior? can anyone please guide me in correct the behavior? Regards, RK  Radhakrishna

login web part form

Hello   i am looking for web part module for login.  So users come to webpage a can see only some sections. If he want to see oter section he have to login first. So i need classical "Login module" which is standard in all CMS.   thanks

membership provider with custom login form problem / question

Hi all, I am using the .net membership provider, and I can get past the membership.validate user ok and into my secure page.   The problem I have is that when I reach the secured page, I have a login status control which isn't changing from login to logout.   Below is my login code:If Membership.ValidateUser(txtUsername.Text, txtPassword.Text) Then Response.Redirect("/auth/Default.aspx") If chkRememberMe.Checked Then FormsAuthentication.SetAuthCookie(txtUsername.Text, True) Else FormsAuthentication.SetAuthCookie(txtUsername.Text, False) End If Else lblLoginStatus.Text = "Oops! Login not found!" End If    Thanks in advance.

How to create a login form using MVC?


Can some one tell me how to make a login form using MVC? I want to make one so that a user can log in if his data has been stored in a SQL database? Thanks.

login form change ASPNETDB.mdf


Hi guys.

i have a database with username and passwords. Can anyone please help me showing how can i make the login form point to my database and do not create a new ASPNETDB.mdf file???I am thinking about using a web service to check if the user is present (is that a good idea??).

Login form always asking to re-login


Is it possible sharepoint and outlook exchange on an AD network  will close the session. The only way I can get my users to authenticate is by shutting down everything and then relogging back in.

The only pattern I see is that outlook or sharepoint is open during these times. My other thought is something on the AD side is blocking the authentication somehow?

Any ideas? I'm basically using the Form Authentication module.

building a login form using linq !?


Hi !

I need help . I need a login form (user/pass) using LINQ. 

I need a sample code for this. Its urgent ...suggest how can i do it ASAP . any open project from where i can take the login part ?

any code you dont mind sharing ?!!



Authenicating but being thrown back to login form on localhost



I am using windows 7 ultimate with vs 2010 ultimate.  I am having a strange problem,  when I try to log into my website Iam prompted for a userid/password by the login control,  I enter in the correct userid and password it authenicates me and then brings me back to the same form..  its like I';m not being loged in but when I run my application in the debugger I see that the "void LoginConrol_LoggedIn(object sender, EventArgs e)" gets hit correctly,  but then I once again get presented with the login for instead of proceeding as being logged it..  if I enter in the incorrect user credentials then I am prompted with the error..  M

Create single custom login page for Windows Authentication and Form Based Authentication.


I want to create a custom login page for both Windows Authentication and Form Based Authentication.

I mean to I have to create only single login page for both authentication.

How can I create this kind of page?

G. Goyal

use Login.aspx Form as a webpart

You cannot vote on your own post hi.

how i can change appearance of FBA form in sharepoint 2007?

I want to show Login part in left navigation in my site? how i can do it?

Im very appriciated if anyone help me & give me a sample.

use Login.aspx Form as a webpart



can i use one sharepoint form such as Login.aspx (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS) as a webpart in my sharepoint homepage site?

i want to change appearance FBA form in sharepoint. i want to use Login part in my homepage in left navigation bar.how can i do that?

Im very appriciated if anyone help me & give me a sample.

Using Login Form with Windows Authentication Problem


Hi all,

I have developed an Interanet web application using the windows Active directory authentication  if user find then it automaticaly authenticated working correctly now  my user wants the capability of being able to login to the intranet site as another user by providing the username and Password .  For example, Team lead needs to login  on other team memeber System to pefrom some task on his behalf  if he or she is not aviable in office .

I have created a standard MS Login Page.  However when I try to login on the page only by providing the Username system authenitcate the user ( not validating the password of that user)

My Web.config is shown below

            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        <authentication mode="Windows"></authentication>
        <identity impersonate="true"/>
            <allow users="*"/>
            <deny users="?"/>


Thanks for your help!

JQuery Validate plugin to validate a ASP.NET Form

The first time I used the JQuery Validate plugin, it did not work at all, see JQuery Validate odd behaviour with the ASP.NET Script Manager for reason, but perseverance and stubbornness prevailed and I finally created my first JQuery validated ASP.NET Forms contact form.

How to use getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend