请问高手,我想把用户配置ProfileProviders中的属性信息用GridView的方式列出来,这个是否可以实现,应该怎么做,谢谢!
解决方案 »
- 关于repeater控件绑定
- 数据库中有保存了很多关键字,在当前网页中查找有哪些关键字
- 散分贴:如何看你的缓存是否有效?
- 关于DATAGRID事件绑定问题,头大了
- 在.aspx页面里为什么不能引用一个WebService的引用,报找不到命名空间?
- 大姐求助:c#+asp.net解决方案,1万以上的树节点,要求异步加载,谁有javascript代码请给我一个完整的示例
- 怎样将两个文本框中的文字连在一起 例如:
- 求助:asp.net里实现从两个查询出结果放到一个存在的新表里
- 简单小问题:VS2002的工具箱里怎么没有<iframe>,难道必须手动添加吗?
- 怎样传这个参数?
- ASP.NET 限制用户重复登录有些什么思路
- outlook!我快让它逼疯了。。。。
GridView1.DataBind();
DataTable dt = new DataTable();
dt.Columns.Add("UserName");
var properties = ProfileBase.Properties.Cast<SettingsProperty>().ToList();
properties.ForEach(property => dt.Columns.Add(property.Name));
foreach (ProfileInfo info in ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All))
{
DataRow row = dt.NewRow();
var profile = Profile.GetProfile(info.UserName);
row["UserName"] = profile.UserName;
properties.ForEach(property=> row[property.Name] = profile.GetPropertyValue(property.Name));
dt.Rows.Add(row);
} GridView1.DataSource = dt;
GridView1.DataBind();
{
ProfileCommon pc = Profile.GetProfile(pi.UserName);
hs.Add(pc);
}
//Lbl.Text = profile.真实姓名; this.GridView1.DataSource = hs;
this.GridView1.DataBind();