(ASP.NET成员资格)如何向aspnet_Profile添加新属性? [英] (ASP.NET Membership) How do I add a new property to aspnet_Profile?

查看:83
本文介绍了(ASP.NET成员资格)如何向aspnet_Profile添加新属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我需要为Profile对象添加两个新属性,以获取asp.net成员身份.

So I need to add two new properties to the Profile object for asp.net membership.

我将这两项添加到了web.config的属性标签中.

I added these two items to the properties tag in web.config.

<group name="Terms">
  <add name="Promotions" type="Bool" serializeAs="String" />
  <add name="AcceptedTerms" type="Bool" serializeAs="string" />
</group>

在我后面的代码中,我可以执行Profile.Terms.Promotions并毫无例外地调用Profile.Save().

In my code behind I am able to do Profile.Terms.Promotions and call Profile.Save() with no exceptions.

但是,aspnet_Profile表似乎没有更新的属性.

However, the aspnet_Profile table does not seem to have the updated properties.

我是否需要在实际的数据库上运行某些内容,例如某种更新脚本?

Do I need to run something on the actual database, like an update script of some sort?

提前谢谢!

由杰克

所以我发现这与我的开发数据库服务器有关.由于某些原因,个人资料信息无法正确保存.所以这是另外一个问题

So I found out it's an issue with my development database server. For some reason Profile info is not saving properly. So this is a whole other issue ha

推荐答案

成员资格配置文件使用它自己的方法来生成表示所需属性的序列化配置文件对象.对于已经在数据库中创建的对象,新属性只有在重新保存后才可能不存在.

Membership profile uses it's own method of generating a serialized profile object that represents the properties you require. On objects that have already been created in the database the new properties might not be present until they have been re-saved.

这篇关于(ASP.NET成员资格)如何向aspnet_Profile添加新属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆