Profile that is used for ASP.NET Profile Service is not available in Page code behind files like in Page_Load.
It may be just a problem with Visual Studio installation/configuration,开发者_Go百科 but as another problem, classes placed in App_Code in not seen in page codes. Even when I'm adding new ASP.NET folder to my project, "App_Code" is not available as an option.
I tested the entire scenario with ASP.NET Web Project and Empty ASP.NET Web Project. This problem does exists while creating ASP.NET Website.
Environment: Visual Studio 2010 Ultimate x64, ASP.NET 4.0, Windows Server 2008 R2 x64.
What may be the problem and how it can be solved?
Profiles only Work Out-of-the-Box with the Web Site Template.
To use Profile in Web project you need to apply a work-around that is available here.
http://code.msdn.microsoft.com/WebProfileBuilder
http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx
精彩评论