Close Search Box
Search Box

Search: From:

Close
Newsletter

9Tutorials to your Inbox



Login Control in Visual Studio 2005

Login Control in Visual Studio 2005
Author lv1 (2000/5000)
2,341 views
1 Star2 Star3Star4 Star5 Star (2 votes, average: 4 out of 5)

As the name implies login control provides GUI to log into a website. As we develop websites login feature is quite common functionality in each and every website.


I have developed more than 10 web applications and all of them has login feature as common. So In VS2005 Microsoft made the job of the developer easy by introducing Login Controls. This reduces coding as well as development cost.

It comes with two labels, two textboxes one for entering UserId and the other for entering password, along with a login button. We can customize the control using auto format. Instruction text and Title text are there to write specific notes that may act as guide to the user. CreateUserText , HelpPageText, PasswordRecoveryText are some of the properties of the login Control that are used to specify text for creating new user, HelpText and the text for password recovery respectively. We can even change the username and password labels. If we enable ‘RememberMeSet’ property to true then remember me check box highlights .By default it’s true.

VIsibleWhenLoggedIn set to true, the control will be hidden on the page if the user is already authenticated. This option very much useful in designing live websites that provides personalized data when the user is logged in to the website.

Implementation

Create a new VS2005 Website. Add a login control from login tab in VS2005 toolbar. I have just given it’s user text for PasswordrecoveryText and CreateUserText and given the corresponding URLs in links Section.
Now Double click on the control. You will be redirected to Authenticate event of Login control in code behind.

Now we need to write code for authenticating a user

Conclusion

The above code is self explanatory. We need to check UserId and Password from database and if it’s matches correctly then ValidateLogin returns true .Otherwise it returns false. It accepts UserId and password fields that we need to pass dynamically as Login1.UserId, Login1.Password that’s it.
If the user is present in Database it returns true else it returns false.This article described usage of login control and authenticating user.

Copyright @ HimaBindu Veeramachaneni 2007

del.icio.us:Login Control in Visual Studio 2005 digg:Login Control in Visual Studio 2005 spurl:Login Control in Visual Studio 2005 newsvine:Login Control in Visual Studio 2005 blinklist:Login Control in Visual Studio 2005 furl:Login Control in Visual Studio 2005 reddit:Login Control in Visual Studio 2005 blogmarks:Login Control in Visual Studio 2005 Y!:Login Control in Visual Studio 2005 magnolia:Login Control in Visual Studio 2005 segnalo:Login Control in Visual Studio 2005
Login




Friends' Sites

Contact Us

Categories

Sponsors

Featured Links

Post a Comment »








Safari hates me

Comment Guidelines

  • Hyperlinks are automatically generated.
  • <em>italic</em>
  • <strong>bold</strong>
  1. Skip mead July 9, 2007

    What prevents the user from entering home.aspx in the browser and by passing the login?