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