绑定函数中的对应代码 //取出指定表的所有记录。 DataTable dtUserInfo = UserManage.GetAllUsers(); // sort the view according to the value stored in the ViewState, in any DataView dvUserInfo = dtUserInfo.DefaultView; if (ViewState["SortExpression"] !=null) dvUserInfo.Sort = ViewState["SortExpression"].ToString(); dg_UserInfo.DataSource = dvUserInfo; dg_UserInfo.DataBind();