How to use Profile in ASP.NET?

To use Profiles in the manner you describe requires a Web Site project. Your question implies that you have a Web Application project.

Using profiles in a Web Application project is a little more work than with a Web Site as the dynamic ProfileCommon class is not generated for you.

Here are some references to help you understand the differences.

http://weblogs.asp.net/anasghanem/archive/2008/04/12/the-differences-in-profile-between-web-application-projects-wap-and-website.aspx

And here is a tool that can make using profiles in Web Applications easier.

http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx