您目前尚未登陆,请选择【登陆】或【注册
首页->新闻文章->社会标签(Tags)文章管理系统源码>>Admin/UserManage.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:社会标签(Tags)文章管理系统源码
当前文件:文件类型 TagsArticle/Admin/UserManage.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using Web2ASPNET2.CommonOperation; 12using Web2ASPNET2.UserCommonOperation; 13 14public partial class Admin_UserManage:System.Web.UI.Page 15{ 16 protected void Page_Load(object sender,EventArgs e) 17 { ///判断用户是否登录 18 UserInfo info = (UserInfo)UserCommonOperation.GetUserInfo(Session); 19 if(info == null) 20 { ///返回到上一个页面 21 Response.Write("<script>history.back()</script>"); 22 ///跳转到登录页面 23 Server.Transfer("~/Portal/UserLogin.aspx"); 24 return; 25 } 26 ///绑定控件的数据 27 if(!Page.IsPostBack) 28 { 29 BindPageData(); 30 } 31 } 32 private void BindPageData() 33 { ///绑定控件的数据 34 Web2ASPNET2.WebTags.User user = new Web2ASPNET2.WebTags.User(); 35 Web2ASPNET2.CommonOperation.DataBinder.BindGridViewData( 36 gvUser,user.GetUsersByDS()); 37 } 38 protected void btnAdd_Click(object sender,EventArgs e) 39 { ///页面重定向 40 Server.Transfer("~/Admin/AddUser.aspx"); 41 } 42 protected void gvUser_RowCommand(object sender,GridViewCommandEventArgs e) 43 { 44 if(e.CommandName == "del") 45 { ///执行删除操作 46 Web2ASPNET2.WebTags.User user = new Web2ASPNET2.WebTags.User(); 47 user.DeleteUser(DataTypeConvert.ConvertToInt(e.CommandArgument.ToString())); 48 ///重新绑定控件数据 49 BindPageData(); 50 } 51 } 52 protected void gvUser_RowDataBound(object sender,GridViewRowEventArgs e) 53 { ///为删除按钮添加确认对话框 54 ImageButton ibtDelete = (ImageButton)e.Row.FindControl("ibtDelete"); 55 if(ibtDelete != null) 56 { 57 ibtDelete.Attributes.Add("onclick","return confirm('你确定要删除所选择的数据行吗?');"); 58 } 59 } 60} 61
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:社会标签(Tags)文章管理系统源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号