您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->达达ASP.NET企业信息管理系统>>ClsView.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:达达ASP.NET企业信息管理系统


当前文件路径:DaDaEnterprise/ClsView.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Collections; 3using System.Configuration; 4using System.Data; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.HtmlControls; 9using System.Web.UI.WebControls; 10using System.Web.UI.WebControls.WebParts; 11 12public partial class ClsView : System.Web.UI.Page 13{ 14 protected void Page_Load(object sender, EventArgs e) 15 { 16 if (!IsPostBack) 17 { 18 Title = ConfigurationManager.AppSettings["Web"] + " - 建站心得"; 19 this.labPage.Text = "1"; 20 this.contrlRepeater(); 21 22 string count = "select count(*) from [View] where ClsId='" 23 + Request.QueryString["id"] + "'"; 24 Count.Text = DataAccess.CountCmd(count).ToString(); 25 26 //左边作品数据源 27 string Works = "select top 15 * from [Works] order by id desc"; 28 Repeater3.DataSource = DataAccess.GetDataSet(Works); 29 Repeater3.DataBind(); 30 31 string cls = "select * from [Class] order by Sort"; 32 DataList1.DataSource = DataAccess.GetDataSet(cls); 33 DataList1.DataBind(); 34 } 35 36 } 37 38 /// <summary> 39 /// 字符截断 40 /// </summary> 41 /// <param name="scatitle"></param> 42 /// <param name="cid"></param> 43 /// <returns></returns> 44 public static string getleft(string scatitle, int cid) 45 { 46 string rtn = ""; 47 if (scatitle.Trim().Length > cid) 48 { 49 rtn = scatitle.Substring(0, cid) + "..."; 50 } 51 else 52 { 53 rtn = scatitle; 54 } 55 return rtn; 56 } 57 58 /// <summary> 59 /// 分页 60 /// </summary> 61 public void contrlRepeater() 62 { 63 string sql = "select * from [View] where ClsId='"+ 64 Request.QueryString["id"]+"'order by id desc"; 65 DataSet Ds = DataAccess.GetDataSet(sql); 66 67 //使用PagedDataSource来实现分页 68 PagedDataSource pds = new PagedDataSource(); 69 pds.DataSource = Ds.Tables[0].DefaultView; 70 pds.AllowPaging = true; 71 pds.PageSize = 15; 72 Label1.Text = pds.Count.ToString(); 73 pds.CurrentPageIndex = Convert.ToInt32(this.labPage.Text) - 1; 74 Repeater2.DataSource = pds; 75 LabCountPage.Text = pds.PageCount.ToString(); 76 labPage.Text = (pds.CurrentPageIndex + 1).ToString(); 77 this.lbtnpritPage.Enabled = true; 78 this.lbtnFirstPage.Enabled = true; 79 this.lbtnNextPage.Enabled = true; 80 this.lbtnDownPage.Enabled = true; 81 if (pds.CurrentPageIndex < 1) 82 { 83 this.lbtnpritPage.Enabled = false; 84 this.lbtnFirstPage.Enabled = false; 85 } 86 if (pds.CurrentPageIndex == pds.PageCount - 1) 87 { 88 this.lbtnNextPage.Enabled = false; 89 this.lbtnDownPage.Enabled = false; 90 } 91 Repeater2.DataBind(); 92 } 93 protected void lbtnpritPage_Click(object sender, EventArgs e) 94 { 95 this.labPage.Text = Convert.ToString(Convert.ToInt32(labPage.Text) - 1); 96 this.contrlRepeater(); 97 } 98 protected void lbtnFirstPage_Click(object sender, EventArgs e) 99 { 100 this.labPage.Text = "1"; 101 this.contrlRepeater(); 102 } 103 protected void lbtnDownPage_Click(object sender, EventArgs e) 104 { 105 this.labPage.Text = this.LabCountPage.Text; 106 this.contrlRepeater(); 107 } 108 109 protected void lbtnNextPage_Click(object sender, EventArgs e) 110 { 111 this.labPage.Text = Convert.ToString(Convert.ToInt32(labPage.Text) + 1); 112 this.contrlRepeater(); 113 } 114} 115
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:达达ASP.NET企业信息管理系统

- 大学课程管理系统程序源码(印度)

- 某国企综合资源管理系统源码

- Asp.net2.0值班管理系统源码

- JaneLee简单购物车源码

- 51aspx省市区县(含全国完整数..

- asp.net生成验证码示例源码(..

- Asp.net酒店管理系统源码

- 文献检索系统源码及毕业论文

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号