Accessing the Profile object from Code Behind Bug? (ASP.NET 2.0 Provider Model)

。_饼干妹妹 提交于 2019-12-08 04:13:15

问题


I have been playing around w/ ASP.NET's Membership, Roles, and Profile providers. In doing so, I recently set up Microsoft Sample's custom Table Profile Provider (see: http://www.asp.net/downloads/sandbox/table-profile-provider-samples/)

When I run the test solution I have programatic access to the Profile variables. I.e. I can type Profile. in the code behind and Intellsense will give me access to my custom Profile variables (setup in the web.config) ... LastName, FirstName, Age, etc.

However, when I set up the same scenario in my own solution and type in Profile. in code-behind, it does not recognize the object in IntelliSense and won't compile if I type it myself.

That being said... If I type <%= Profile. in the front end, VS gives me what I'm looking for (the front end Intellisense pops up with my defined Profile variables)

Has anyone else had this problem / Know a solution

Thanks!

-Mike


回答1:


For Web Application projects, see here: http://code.msdn.microsoft.com/WebProfileBuilder




回答2:


Seems my issue is that Profile is only valid for the VS.NET Website Template (NOT for the Web Application Template)

-Mike



来源:https://stackoverflow.com/questions/407845/accessing-the-profile-object-from-code-behind-bug-asp-net-2-0-provider-model

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