您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->明日供求信息网源码>>ShowPage/webPX.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:明日供求信息网源码
当前文件:文件类型 MingriGongQiu/ShowPage/webPX.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; 11 12public partial class ShowPage_webPX : System.Web.UI.Page 13{ 14 Operation operation = new Operation(); 15 static string infoType = ""; 16 static string infoKey = ""; 17 static PagedDataSource pds = new PagedDataSource(); 18 19 protected void Page_Load(object sender, EventArgs e) 20 { 21 if (!IsPostBack) 22 { 23 infoType = "培训信息"; 24 infoKey = Convert.ToString(Session["key"]); 25 this.DataListBind(); 26 27 dlCharge.DataSource = operation.SelectLeaguerInfo(true, infoType); 28 dlCharge.DataBind(); 29 Session["key"] = null; 30 } 31 } 32 /// <summary> 33 /// 将数据绑定到DataList控件 34 /// </summary> 35 public void DataListBind() 36 { 37 pds = operation.PageDataListBind(infoType, infoKey, Convert.ToInt32(lblCurrentPage.Text), 10); 38 lnkBtnFirst.Enabled = true;      //控件翻页控件都设置为可用 39 lnkBtnLast.Enabled = true; 40 lnkBtnNext.Enabled = true; 41 lnkBtnPrevious.Enabled = true; 42 if (lblCurrentPage.Text == "1")   //如果当前显示第一页,“第一页”和“上一页”按钮不可用。 43 { 44 lnkBtnPrevious.Enabled = false; 45 lnkBtnFirst.Enabled = false; 46 } 47 if (lblCurrentPage.Text == pds.PageCount.ToString())  //如果显示最后一页,“末一页”和“下一页”按钮不可用。 48 { 49 lnkBtnNext.Enabled = false; 50 lnkBtnLast.Enabled = false; 51 } 52 lblSumPage.Text = pds.PageCount.ToString();  //实现总页数 53 dlFree.DataSource = pds;            //绑定数据源 54 dlFree.DataKeyField = "id"; 55 dlFree.DataBind(); 56 } 57 protected void lnkBtnFirst_Click(object sender, EventArgs e) 58 { 59 lblCurrentPage.Text = "1"; 60 DataListBind(); 61 } 62 protected void lnkBtnPrevious_Click(object sender, EventArgs e) 63 { 64 lblCurrentPage.Text = (Convert.ToInt32(lblCurrentPage.Text) - 1).ToString(); 65 DataListBind(); 66 } 67 protected void lnkBtnNext_Click(object sender, EventArgs e) 68 { 69 lblCurrentPage.Text = (Convert.ToInt32(lblCurrentPage.Text) + 1).ToString(); 70 DataListBind(); 71 } 72 protected void lnkBtnLast_Click(object sender, EventArgs e) 73 { 74 lblCurrentPage.Text = lblSumPage.Text; 75 DataListBind(); 76 } 77} 78
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:明日供求信息网源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号