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