从访问code缺陷背后Profile对象? (ASP.NET 2.0提供者模型) [英] Accessing the Profile object from Code Behind Bug? (ASP.NET 2.0 Provider Model)
问题描述
我一直在玩弄瓦特/ ASP.NET的成员资格,角色和配置文件提供者。这样做,我最近成立了微软样品的定制表档案提供商(参见:的 http://www.asp.net/downloads/sandbox/table-profile-provider-samples/ )
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/)
当我运行测试解决方案,我必须将档案变量编程方式访问。即我可以输入个人资料。在后面的Intellsense code会给我访问我的自定义配置变量(在web.config中设置)...姓氏,名字,年龄等。
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.
然而,当我设置了同样的情景在我自己的解决方案,并输入个人资料。在code-的背后,则不能识别物体的智能感知,如果我键入它自己将无法编译。
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.
话虽这么说......如果我的类型<%=档案。在前端,VS给了我什么,我正在寻找(前端智能感知弹出我的定义配置文件变量)
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
谢谢!
-Mike
推荐答案
看来我的问题是,个人资料仅适用于VS.NET的网站模板(不适用于Web应用程序模板)
Seems my issue is that Profile is only valid for the VS.NET Website Template (NOT for the Web Application Template)
-Mike
这篇关于从访问code缺陷背后Profile对象? (ASP.NET 2.0提供者模型)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!