How to use Profile in ASP.NET?

霸气de小男生 提交于 2019-12-04 06:36:49
Sky Sanders

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

GMG

This URL describes how to work around the issue with Profiles within a Web Application: Using ASP.Net Profile Feature in a Web Application Project

Add this namespace in your page System.Web.Profile

using System.Web.Profile;
Juan Felipe

The problem is that Profile Already exists in web.config. So you have to add your properties into the profile, erase the using System.Web.Profile and write it again (Using System.Web.Profile;).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!