If you use the Login control with ASP.NET membership, you do not need to wirte code to perform authentication.
By defaut, ASP.NET forms authentication is configured to work with a page named Login.aspx. You can change the default login page name in the Web config file for your application using the LoginUrl property.
Walkthrough: Managing Web Site Users with Roles
http://msdn.microsoft.com/en-us/library/t32yf0a9.aspx
How to: Create an ASP.NET Login Page
http://msdn.microsoft.com/en-us/library/ms178331(VS.80).aspx