简体   繁体   中英

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

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. Ie 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

对于Web应用程序项目,请参见此处: http : //code.msdn.microsoft.com/WebProfileBuilder

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

-Mike

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM