How to assign Profile values?

前端 未结 10 636
别那么骄傲
别那么骄傲 2020-11-22 08:49

I don\'t know what I am missing, but I added Profile properties in the Web.config file but cannot access Profile.Item in the code or create a new profile.

10条回答
  •  抹茶落季
    2020-11-22 09:19

    If you are using a web application project, you cannot access the Profile object at design-time out-of-the-box. Here is a utility that supposedly does it for you: http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx. Personally, that utility caused an error in my project so I ended up rolling my own profile class to inherit from ProfileBase. It was not hard to do at all.

提交回复
热议问题