2

when I add this code to my root web.config under system.web

<profile>
  <properties>
    <add name="UserId" type="String"/>

  </properties>
</profile>

and rebuild my project, the properties don't seem to take.

Profile.UserId does not exist. Is there something obvious that I'm doing wrong? Thanks.

4

1 回答 1

1

配置文件不是开箱即用的 Web 应用程序项目模板实现的:

http://codersbarn.com/post/2008/07/10/ASPNET-PayPal-Subscriptions-IPN.aspx

http://leedumond.com/blog/asp-net-profiles-in-web-application-projects/

您是否真正实施了它,或者您只是处于计划阶段?如果是后者,那么上面的链接应该提供一些有价值的信息。这也适用于 MVC AFAIK - 请参阅此问题:

如何分配配置文件值?[查看乔尔·斯波尔斯基的回答]

于 2012-09-24T02:16:47.340 回答