简体   繁体   English

Asp.net:“ProfileCommon”不包含“保存”的定义

[英]Asp.net: 'ProfileCommon' does not contain a definition for 'save'

I was working in a web application. 我正在使用Web应用程序。 i used my coustom profile provider, but i had not access to my values so i red this and used the @colivier answer . 我用我的coustom配置文件提供者,但我没有访问我的价值,所以我红和所使用的@colivier答案。

dynamic profile = ProfileBase.Create(Membership.GetUser().UserName);
string s = profile.GivenName;
profile.Surname = "Smith";

Now my problem is i can not save the profile after setting the values.In 现在我的问题是设置值后我无法保存配置文件。

profile.Save(); profile.Save();

it gives me the error: 它给了我错误:

 **'ProfileCommon' does not contain a definition for 'save'**

here is the web.config: 这是web.config:

  <properties >
    <add name="UserName" />

    <add name="Name"   />

    <add name="LastName"/>

    <add name="Email"/>

    <add name="Level"/>

    <add name="Disabled"/>

  </properties>

</profile>

从错误消息来看,看起来“保存”应该是“保存”(区分大小写)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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