富贵资源网 Design By www.hznty.com
复制代码 代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;
using System.Data.SqlClient;
using System.Data;
public partial class Test_RepeaterFENYE : System.Web.UI.Page
{
private readonly static CategoryBLL cb = new CategoryBLL();
private readonly static Category_Info cgi = new Category_Info();
int Menu_ID = 0;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
private void BindData()
{
IList<Category_Info> li = cb.GetAllCategory();
if (li.Count > 0)
{
PagedDataSource pds = new PagedDataSource();
pds.DataSource = li;
pds.AllowPaging = true;
pds.PageSize =2;
int curPage;
if (Request.QueryString["page"] != null)
{
curPage = Convert.ToInt32(Request.QueryString["page"]);
}
else
{
curPage = 1;
}
pds.CurrentPageIndex = curPage - 1;
this.Repeater1.DataSource = pds;
this.Repeater1.DataBind();
this.Label4.Text = "";
this.Label4.Text += "<a>共有<font color=red><b>" + li.Count.ToString() + "</b></font>条记录</a> ";
this.Label4.Text += "<a>每页显示<font color=red><b>" + pds.PageSize + "</b></font>条</a> ";
this.Label4.Text += "<a>共<font color=red><b>" + pds.PageCount.ToString() + "</b></font>页</a> ";
this.Label4.Text += "<a>当前第<font color=red><b>" + curPage.ToString() + "</b></font>页</a> ";
if (curPage == 1)
{
this.Label4.Text += "<a>首页</a> ";
this.Label4.Text += "<a>上一页</a> ";
}
else
{
//this.Label4.Text += "<a href='wjProduct-1-" + Menu_ID + ".html'>首页</a> ";
//this.Label4.Text += "<a href='wjProduct-" + (curPage - 1).ToString() + "-" + Menu_ID + ".html'>上一页</a> ";
this.Label4.Text += "<a href='RepeaterFENYE.aspx'>首页</a> ";
this.Label4.Text += "<a href='RepeaterFENYE.aspx?page="+(curPage - 1).ToString()+"'>上一页</a> ";
}
if (curPage == pds.PageCount)
{
this.Label4.Text += "<a>下一页</a> ";
this.Label4.Text += "<a>尾页</a> ";
}
else
{
this.Label4.Text += "<a href='RepeaterFENYE.aspx?page=" + (curPage + 1).ToString() + "'>下一页</a> ";
this.Label4.Text += "<a href='RepeaterFENYE.aspx?page=" + pds.PageCount.ToString() + "'>尾页</a> ";
//this.Label4.Text += "<a href='wjProduct-" + (curPage + 1).ToString() + "-" + Menu_ID + ".html'>下一页</a> ";
//this.Label4.Text += "<a href='wjProduct-" + pds.PageCount.ToString() + "-" + Menu_ID + ".html'>尾页</a> ";
}
string HtmlSelectString = "<select onchange=\"javascript:window.location=this.value\">";
for (int i = 1; i <= pds.PageCount; i++)
{
if (i == curPage)
{
//HtmlSelectString += "<option value=wjProduct-" + i + "-" + Menu_ID + ".html selected>第" + i + "页</option>";
HtmlSelectString += "<option value='RepeaterFENYE.aspx?page=" + i.ToString() +"' selected>第" + i + "页</option>";
}
else
{
//HtmlSelectString += "<option value=wjProduct-" + i + "-" + Menu_ID + ".html>第" + i + "页</option>";
HtmlSelectString += "<option value='RepeaterFENYE.aspx?page=" + i.ToString() + "'>第" + i + "页</option>";
}
}
HtmlSelectString += "</select>";
this.Label4.Text += "<a>" + HtmlSelectString + "</a>";
}
else
{
Label4.Text = "没有数据!";
}
}
}
注://注释部分为url rewrite的效果。。。li返回的值为SQL查询后所得到表中所有的记录。。。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;
using System.Data.SqlClient;
using System.Data;
public partial class Test_RepeaterFENYE : System.Web.UI.Page
{
private readonly static CategoryBLL cb = new CategoryBLL();
private readonly static Category_Info cgi = new Category_Info();
int Menu_ID = 0;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
private void BindData()
{
IList<Category_Info> li = cb.GetAllCategory();
if (li.Count > 0)
{
PagedDataSource pds = new PagedDataSource();
pds.DataSource = li;
pds.AllowPaging = true;
pds.PageSize =2;
int curPage;
if (Request.QueryString["page"] != null)
{
curPage = Convert.ToInt32(Request.QueryString["page"]);
}
else
{
curPage = 1;
}
pds.CurrentPageIndex = curPage - 1;
this.Repeater1.DataSource = pds;
this.Repeater1.DataBind();
this.Label4.Text = "";
this.Label4.Text += "<a>共有<font color=red><b>" + li.Count.ToString() + "</b></font>条记录</a> ";
this.Label4.Text += "<a>每页显示<font color=red><b>" + pds.PageSize + "</b></font>条</a> ";
this.Label4.Text += "<a>共<font color=red><b>" + pds.PageCount.ToString() + "</b></font>页</a> ";
this.Label4.Text += "<a>当前第<font color=red><b>" + curPage.ToString() + "</b></font>页</a> ";
if (curPage == 1)
{
this.Label4.Text += "<a>首页</a> ";
this.Label4.Text += "<a>上一页</a> ";
}
else
{
//this.Label4.Text += "<a href='wjProduct-1-" + Menu_ID + ".html'>首页</a> ";
//this.Label4.Text += "<a href='wjProduct-" + (curPage - 1).ToString() + "-" + Menu_ID + ".html'>上一页</a> ";
this.Label4.Text += "<a href='RepeaterFENYE.aspx'>首页</a> ";
this.Label4.Text += "<a href='RepeaterFENYE.aspx?page="+(curPage - 1).ToString()+"'>上一页</a> ";
}
if (curPage == pds.PageCount)
{
this.Label4.Text += "<a>下一页</a> ";
this.Label4.Text += "<a>尾页</a> ";
}
else
{
this.Label4.Text += "<a href='RepeaterFENYE.aspx?page=" + (curPage + 1).ToString() + "'>下一页</a> ";
this.Label4.Text += "<a href='RepeaterFENYE.aspx?page=" + pds.PageCount.ToString() + "'>尾页</a> ";
//this.Label4.Text += "<a href='wjProduct-" + (curPage + 1).ToString() + "-" + Menu_ID + ".html'>下一页</a> ";
//this.Label4.Text += "<a href='wjProduct-" + pds.PageCount.ToString() + "-" + Menu_ID + ".html'>尾页</a> ";
}
string HtmlSelectString = "<select onchange=\"javascript:window.location=this.value\">";
for (int i = 1; i <= pds.PageCount; i++)
{
if (i == curPage)
{
//HtmlSelectString += "<option value=wjProduct-" + i + "-" + Menu_ID + ".html selected>第" + i + "页</option>";
HtmlSelectString += "<option value='RepeaterFENYE.aspx?page=" + i.ToString() +"' selected>第" + i + "页</option>";
}
else
{
//HtmlSelectString += "<option value=wjProduct-" + i + "-" + Menu_ID + ".html>第" + i + "页</option>";
HtmlSelectString += "<option value='RepeaterFENYE.aspx?page=" + i.ToString() + "'>第" + i + "页</option>";
}
}
HtmlSelectString += "</select>";
this.Label4.Text += "<a>" + HtmlSelectString + "</a>";
}
else
{
Label4.Text = "没有数据!";
}
}
}
注://注释部分为url rewrite的效果。。。li返回的值为SQL查询后所得到表中所有的记录。。。
富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com
暂无评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?