Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profile service is not available in code in Page_Load within ASP.NET Web Projects

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, 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?

like image 338
Afshar Mohebi Avatar asked Dec 04 '25 15:12

Afshar Mohebi


1 Answers

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

like image 139
this. __curious_geek Avatar answered Dec 07 '25 05:12

this. __curious_geek