您目前尚未登陆,请选择【登陆】或【注册
首页->新闻文章->多层文章管理系统源码>>Web/Controls/AdminArticle.ascx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:多层文章管理系统源码
当前文件:文件类型 MultiLayerArticle/Web/Controls/AdminArticle.ascx.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 SqlServerBLL; 12using System.Collections.Generic; 13 14public partial class Controls_AdminArticle : System.Web.UI.UserControl 15{ 16 Admins adminBLL = new Admins(); 17 protected void Page_Load(object sender, EventArgs e) 18 { 19 if (!IsPostBack) 20 { 21 DataBindPage(); 22 } 23 } 24 public void DataBindPage() 25 { 26 string sUrl = ""; 27 int iPageIndex = 0; 28 int iPageSize = 20; 29 int iType = 0; 30 int iUserID = 0; 31 string sName = HttpUtility.UrlDecode(Request.QueryString["title"]); 32 string sSummary = HttpUtility.UrlDecode(Request.QueryString["summary"]); 33 string sType = Request.QueryString["type"]; 34 string sPageIndex = Request.QueryString["PageIndex"]; 35 if (!string.IsNullOrEmpty(sName)) 36 { 37 sUrl += "&title=" + HttpUtility.UrlEncode(sName); 38 } 39 if (!string.IsNullOrEmpty(sSummary)) 40 { 41 sUrl += "&summary=" + HttpUtility.UrlEncode(sSummary); 42 } 43 if (!string.IsNullOrEmpty(sType)) 44 { 45 sUrl += "&type=" + sType; 46 int.TryParse(sType, out iType); 47 } 48 if (!string.IsNullOrEmpty(sPageIndex)) 49 { 50 int.TryParse(sPageIndex, out iPageIndex); 51 } 52 53 DataSet dsArticle = adminBLL.GetArticle(iPageIndex, iPageSize, iType, sName, sSummary); 54 if (dsArticle != null && dsArticle.Tables.Count == 2) 55 { 56 repeaterArticle.DataSource = dsArticle.Tables[0]; 57 repeaterArticle.DataBind(); 58 int iCount = Convert.ToInt32(dsArticle.Tables[1].Rows[0][0]); 59 spTop.PageCount = iCount; 60 spTop.PageIndex = iPageIndex; 61 spTop.PageSize = iPageSize; 62 spTop.Parameter = sUrl; 63 spBottom.PageCount = iCount; 64 spBottom.PageIndex = iPageIndex; 65 spBottom.PageSize = iPageSize; 66 spBottom.Parameter = sUrl; 67 dsArticle.Dispose(); 68 } 69 } 70 71 protected void lBtnDelete_Click(object sender, EventArgs e) 72 { 73 string sid = hf_id.Value; 74 if (adminBLL.DeleteArticleByIds(sid)) 75 { 76 Page.ClientScript.RegisterClientScriptBlock(GetType(), "delete", "alert('删除成功');window.location.href='AdminArticle.aspx';", true); 77 } 78 else 79 { 80 Page.ClientScript.RegisterClientScriptBlock(GetType(), "deleteError", "alert('删除出现错误');", true); 81 } 82 } 83 84 85} 86
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:多层文章管理系统源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号