我按照说明上配置了profile,      
<anonymousIdentification enabled="true" />      <profile>
        <properties>
          <add
name="FirstName"
defaultValue="??"
allowAnonymous="true" />        </properties>
      </profile>
可是为什么在程序中我用prifile的时候,提示不存在

解决方案 »

  1.   

    <!-- Profile 用户信息配置 -->
        <profile enabled="true" defaultProvider="voptProvider" automaticSaveEnabled="true">
          <providers>
            <add name="voptProvider"
                 type="System.Web.Profile.SqlProfileProvider"
                 connectionStringName="voptAspNetDB"
                 description="Profile 驱动配置"
                 />
          </providers>
            <!-- Profile 用户信息定义 -->
          <properties>
            <group name="Person">
              <add name="email" allowAnonymous="true" type="System.String" />
            </group>
          </properties>
        </profile>
          <!-- Profile 匿名用户信息模式启用 -->
        <anonymousIdentification enabled="true"/>
      

  2.   

    按照 
    wuyq11的配置,结果还是引用不了profile,除了配置web.config文件外,需要做别的配置吗,比如加入什么引用文件?
      

  3.   

    已经解决:因为我建的是一个web项目,而不是一个网站。
    在 Visual Studio 2008 网站项目中,ASP.NET 会自动向项目中的每个 ASP.NET 网页添加一个 Profile 对象(ProfileCommon 类的实例)。此对象可对应用程序 Web.config 文件的 profile 节中所定义的全部属性提供强类型访问。您可以获取此对象的 IntelliSense 数据,并自动在其中保存和检索值。Visual Studio 2008 Web 应用程序项目不会自动包含 ProfileCommon 类。但是,您可以创建自己的 ProfileCommon 类,并在其中包含配置文件系统中已配置项的强类型属性。随后,您可以访问 HttpContext 对象的当前 Profile 属性,以获取并设置这些强类型属性。下面的示例演示如何创建包含在 Class1.cs(对于 Visual Basic 则为 Class1.vb)文件中的自定义 ProfileCommon 类。