zoukankan      html  css  js  c++  java
  • Profilemanager管理类的应用

    ProfileManager与ProfileBase类相同,在使用ProfileManager时一定记得引用System.web.profile名字空间.该类主要用于管理用户配置属性\搜索用户配置属性,以及删除不再使用的用户配置\更新等等.

    1\读取所有PROFILE用户信息
        
    程序代码 程序代码
    GridView1.DataSource = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All);
            GridView1.DataBind();



    2\该ProfileInfo对象集合是由 ProfileManager的GetAllProfiles方法获得的。当你点击GridView1中的任意一行的Select链接时,你将会看到该用户的自定义基本资料表;

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProfileCommon SelectedProfile = Profile.GetProfile(GridView1.SelectedValue.ToString());
            TextBox1.Text = SelectedProfile.QQ;
            TextBox2.Text = SelectedProfile.msn;
        }

    3\DataKeyNames 属性指定数据键  早上测试时就漏了这个关键字导致无法正常显示这里的DataKeyNames=UserName

    详细的源码将在后面上传给大家下载参考
  • 相关阅读:
    三周#学习进度总结
    四则运算(修改版)
    是否需要有代码规范?
    结对项目:代码复审+PSP
    二周#学习进度总结
    GitHub注册流程(中英对比)
    四则运算:我的设计和设想(未完成版)
    Spring4总结
    Hibernate5总结
    Struts2总结
  • 原文地址:https://www.cnblogs.com/Bany/p/1755483.html
Copyright © 2011-2022 走看看