ASP.net成员添加自定义栏 [英] ASP.net membership add custom column

查看:96
本文介绍了ASP.net成员添加自定义栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的母版页我有:

MembershipUser thisUser = Membership.GetUser();
loggedInUserID = thisUser.ProviderUserKey.ToString();

thisUser 给我访问所有字段 aspnet_Membership

我想一个新的领域, isSubscribed 为每个用户。我可以使用一个SQL查询来获取价值很好,但我想知道是否有这样好歹它检索这个值,以及修改对象的MembershipUser,所以它是从访问:

I want a new field, isSubscribed for each user. I can use an SQL query to fetch the value fine, but I want to know if there is someway to modify the membershipuser object so it retrieves this value as well, so it is accessible from:

thisUser.isSubscribed.ToString();

感谢您的帮助!

推荐答案

您需要将字段添加到配置文件提供

you will need to add the field to the Profile Provider

配置文件提供的描述可以在这里找到。

A description of the Profile provider can be found here.

<一个href=\"http://msdn.microsoft.com/en-us/library/2y3fs9xs.aspx\">http://msdn.microsoft.com/en-us/library/2y3fs9xs.aspx

下面是从文章

与个人用户,并存储在一个持续的格式。配置文件允许您无需创建和维护自己的数据库管理用户信息,信息的ASP.NET配置文件功能同伙的情况。另外,ASP.NET配置文件功能使得使用强类型的API,你可以在应用程序的任何地方访问提供的用户信息。

"The ASP.NET profile feature associates information with an individual user and stores the information in a persistent format. Profiles allow you to manage user information without requiring you to create and maintain your own database. In addition, the ASP.NET profile feature makes the user information available using a strongly typed API that you can access from anywhere in your application."

这篇关于ASP.net成员添加自定义栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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