protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (e.CommandName == "EnableUr")
            {
                //int index = ((ListViewDataItem)e.Item).DisplayIndex;
                //Guid id = (Guid)ListView1.DataKeys[index].Value;
                int index = ((ListViewDataItem)e.Item).DisplayIndex;
                Guid id = (Guid)ListView1.DataKeys[index].Value;
                T_UsersTableAdapter adapter = new T_UsersTableAdapter();
                adapter.EnableUrById(id);
                ListView1.DataBind();
            }
            else if (e.CommandName == "DisableUr")
            {
                int index = ((ListViewDataItem)e.Item).DisplayIndex;
                Guid id = (Guid)ListView1.DataKeys[index].Value;
                T_UsersTableAdapter adapter = new T_UsersTableAdapter();
                adapter.DiableUrById(id);
                ListView1.DataBind();
            }
        }

  


相关文章:

  • 2021-10-03
  • 2021-06-13
  • 2022-12-23
  • 2022-02-11
  • 2021-07-13
  • 2021-09-25
  • 2021-03-31
  • 2022-02-20
猜你喜欢
  • 2022-12-23
  • 2021-07-12
  • 2021-07-07
  • 2021-06-28
  • 2022-12-23
  • 2021-12-27
相关资源
相似解决方案