富贵资源网 Design By www.hznty.com
JS代码:
Code:
复制代码 代码如下:
var _MaxPageSize = 0;
var _PageSize = 5;
var _IsUpDown = false;
function InitPage(funName, currentPageSize, maxPageSize, pageSize, isUpDown) {
_FunName = funName;
_CurrentPageSize = currentPageSize;
_MaxPageSize = maxPageSize;
_PageSize = pageSize;
_IsUpDown = isUpDown;
}
function ShowPage(objDiv) {
var strResult = "";
var size = Math.floor(_PageSize / 2);
var maxSize = _CurrentPageSize + size > _MaxPageSize ? _MaxPageSize : _CurrentPageSize + size;
var minSize = _CurrentPageSize - size < 1 ? 1 : _CurrentPageSize - size;
if (maxSize == _MaxPageSize)
minSize = maxSize - _PageSize + 1;
if (minSize == 1)
maxSize = minSize + _PageSize - 1;
var str = "";
for (var i = 0; i < _MaxPageSize; i++) {
var curPage = i + 1;
if (curPage == 1 || (curPage >= minSize && curPage <= maxSize) || curPage == _MaxPageSize) {
var strPage = "";
if (curPage == minSize && (_CurrentPageSize > _PageSize || minSize > 2))
strPage += "... ";
if (_CurrentPageSize == curPage) {
strPage += " <a href='#' style='font-size:14px;color:red'>" + curPage + "</a>";
}
else {
strPage += " <a href=\"#\" style='font-size:14px' onclick=\"" + _FunName + "(" + curPage + ");\">" + curPage + "</a>";
}
if (curPage == maxSize && _MaxPageSize - _CurrentPageSize - 1 > size) {
strPage += "... ";
}
strResult += strPage;
}
}
strResult += "";
if (_IsUpDown) {
if (_CurrentPageSize == 1)
strResult = "<a href='#' >上一页</a>" + strResult;
else
strResult = " <a href=\"#\" onclick=\"" + _FunName + "(" + (_CurrentPageSize - 1) + ");\">上一页</a>" + strResult;
if (_CurrentPageSize == _MaxPageSize) {
strResult = strResult + " <a>下一页</a></ul>";
}
else {
strResult = strResult + " <a href=\"#\" onclick=\"" + _FunName + "(" + (_CurrentPageSize + 1) + ");\">下一页</a>";
}
}
document.getElementById(objDiv).innerHTML =strResult;
}
HTML Code:
复制代码 代码如下:
<script src="/UploadFiles/2021-04-02/PageViewJS.js"><script language="javascript" type="text/javascript">
function GetCurPage(curPage) {
//取当前页信息
document.forms[0].action = "ChrisBlessingList.aspx?Page=" + curPage;
document.forms[0].submit();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="width: 1002px; margin: 0 auto;">
<div id="hdgz"><img src="/UploadFiles/2021-04-02/sdzt_07.jpg"><div id="liebiao">
<div class="a_01" id="Container">
<ul class="lb">
<asp:DataList ID="ddlBlessingList" runat="server" Width="100%">
<ItemTemplate>
<li class="bg01">
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="90" rowspan="2">
<img src="images/sdzt_02/img.jpg"></td>
<td width="600" align="left" valign="middle" class="font_07">
<%#Eval("User_Name")%>
对 【
<%#Eval("To_UserName")%>】说:
</td>
</tr>
<tr>
<td align="left" valign="top" class="font_07" style="word-break: break-all; width: 600px;
overflow: auto;">
<%#Eval("To_Context")%>
</td>
</tr>
</table>
</li>
</ItemTemplate>
</asp:DataList>
</ul>
</div>
<div class="fy">
<div id="divPage">
</div>
</div>
</div>
<div id="back_zhufu">
</div>
</div>
</div>
<asp:Literal ID="ltScript" runat="server"></asp:Literal>
</form>
</body>
</html>
C# Code:
复制代码 代码如下:
private int _MaxPageSize = 1;
protected void Page_Load(object sender, EventArgs e)
{
int page = 1;
if (Request.QueryString["Page"] != null && Request.QueryString["Page"].ToString() != "")
{
page = Convert.ToInt32(Request.QueryString["Page"]);
}
int _PageSize = 5;
BindChristData(page, _PageSize);
ltScript.Text = "<script language=\"javascript\" type=\"text/javascript\">InitPage(\"GetCurPage\", " + page + ", " + _MaxPageSize + ", 8, true); ShowPage(\"divPage\");</script>";
}
private void BindChristData(int pageIndex, int pageSize)
{
int intStartIndex = (pageIndex - 1) * pageSize + 1;
int intEndIndex = pageIndex * pageSize;
DataSet tChrisTable = TChristmaxWishBLL.GetTChristmaxWish(intStartIndex, intEndIndex);
if (tChrisTable != null && tChrisTable.Tables[0].Rows.Count > 0)
{
ddlBlessingList.DataSource = tChrisTable;
ddlBlessingList.DataBind();
_MaxPageSize = Convert.ToInt32(tChrisTable.Tables[1].Rows[0][0].ToString()) % pageSize == 0 ? Convert.ToInt32(tChrisTable.Tables[1].Rows[0][0].ToString()) / pageSize : Convert.ToInt32(tChrisTable.Tables[1].Rows[0][0].ToString()) / pageSize + 1;
}
}
Sql语句:
select row_num,User_Name,User_Email,User_Phone,To_UserName,To_Context from(SELECT ROW_NUMBER() OVER ( ORDER BY To_Date desc)as row_num,User_Name,User_Email,User_Phone,To_UserName,To_Context from TChristmaxWish where Is_Del=0 )as newTable where row_num between @intStrIndex and @intEndIndex;
select count(id) from TChristmaxWish where Is_Del=0
Code:
复制代码 代码如下:
var _MaxPageSize = 0;
var _PageSize = 5;
var _IsUpDown = false;
function InitPage(funName, currentPageSize, maxPageSize, pageSize, isUpDown) {
_FunName = funName;
_CurrentPageSize = currentPageSize;
_MaxPageSize = maxPageSize;
_PageSize = pageSize;
_IsUpDown = isUpDown;
}
function ShowPage(objDiv) {
var strResult = "";
var size = Math.floor(_PageSize / 2);
var maxSize = _CurrentPageSize + size > _MaxPageSize ? _MaxPageSize : _CurrentPageSize + size;
var minSize = _CurrentPageSize - size < 1 ? 1 : _CurrentPageSize - size;
if (maxSize == _MaxPageSize)
minSize = maxSize - _PageSize + 1;
if (minSize == 1)
maxSize = minSize + _PageSize - 1;
var str = "";
for (var i = 0; i < _MaxPageSize; i++) {
var curPage = i + 1;
if (curPage == 1 || (curPage >= minSize && curPage <= maxSize) || curPage == _MaxPageSize) {
var strPage = "";
if (curPage == minSize && (_CurrentPageSize > _PageSize || minSize > 2))
strPage += "... ";
if (_CurrentPageSize == curPage) {
strPage += " <a href='#' style='font-size:14px;color:red'>" + curPage + "</a>";
}
else {
strPage += " <a href=\"#\" style='font-size:14px' onclick=\"" + _FunName + "(" + curPage + ");\">" + curPage + "</a>";
}
if (curPage == maxSize && _MaxPageSize - _CurrentPageSize - 1 > size) {
strPage += "... ";
}
strResult += strPage;
}
}
strResult += "";
if (_IsUpDown) {
if (_CurrentPageSize == 1)
strResult = "<a href='#' >上一页</a>" + strResult;
else
strResult = " <a href=\"#\" onclick=\"" + _FunName + "(" + (_CurrentPageSize - 1) + ");\">上一页</a>" + strResult;
if (_CurrentPageSize == _MaxPageSize) {
strResult = strResult + " <a>下一页</a></ul>";
}
else {
strResult = strResult + " <a href=\"#\" onclick=\"" + _FunName + "(" + (_CurrentPageSize + 1) + ");\">下一页</a>";
}
}
document.getElementById(objDiv).innerHTML =strResult;
}
HTML Code:
复制代码 代码如下:
<script src="/UploadFiles/2021-04-02/PageViewJS.js"><script language="javascript" type="text/javascript">
function GetCurPage(curPage) {
//取当前页信息
document.forms[0].action = "ChrisBlessingList.aspx?Page=" + curPage;
document.forms[0].submit();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="width: 1002px; margin: 0 auto;">
<div id="hdgz"><img src="/UploadFiles/2021-04-02/sdzt_07.jpg"><div id="liebiao">
<div class="a_01" id="Container">
<ul class="lb">
<asp:DataList ID="ddlBlessingList" runat="server" Width="100%">
<ItemTemplate>
<li class="bg01">
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="90" rowspan="2">
<img src="images/sdzt_02/img.jpg"></td>
<td width="600" align="left" valign="middle" class="font_07">
<%#Eval("User_Name")%>
对 【
<%#Eval("To_UserName")%>】说:
</td>
</tr>
<tr>
<td align="left" valign="top" class="font_07" style="word-break: break-all; width: 600px;
overflow: auto;">
<%#Eval("To_Context")%>
</td>
</tr>
</table>
</li>
</ItemTemplate>
</asp:DataList>
</ul>
</div>
<div class="fy">
<div id="divPage">
</div>
</div>
</div>
<div id="back_zhufu">
</div>
</div>
</div>
<asp:Literal ID="ltScript" runat="server"></asp:Literal>
</form>
</body>
</html>
C# Code:
复制代码 代码如下:
private int _MaxPageSize = 1;
protected void Page_Load(object sender, EventArgs e)
{
int page = 1;
if (Request.QueryString["Page"] != null && Request.QueryString["Page"].ToString() != "")
{
page = Convert.ToInt32(Request.QueryString["Page"]);
}
int _PageSize = 5;
BindChristData(page, _PageSize);
ltScript.Text = "<script language=\"javascript\" type=\"text/javascript\">InitPage(\"GetCurPage\", " + page + ", " + _MaxPageSize + ", 8, true); ShowPage(\"divPage\");</script>";
}
private void BindChristData(int pageIndex, int pageSize)
{
int intStartIndex = (pageIndex - 1) * pageSize + 1;
int intEndIndex = pageIndex * pageSize;
DataSet tChrisTable = TChristmaxWishBLL.GetTChristmaxWish(intStartIndex, intEndIndex);
if (tChrisTable != null && tChrisTable.Tables[0].Rows.Count > 0)
{
ddlBlessingList.DataSource = tChrisTable;
ddlBlessingList.DataBind();
_MaxPageSize = Convert.ToInt32(tChrisTable.Tables[1].Rows[0][0].ToString()) % pageSize == 0 ? Convert.ToInt32(tChrisTable.Tables[1].Rows[0][0].ToString()) / pageSize : Convert.ToInt32(tChrisTable.Tables[1].Rows[0][0].ToString()) / pageSize + 1;
}
}
Sql语句:
select row_num,User_Name,User_Email,User_Phone,To_UserName,To_Context from(SELECT ROW_NUMBER() OVER ( ORDER BY To_Date desc)as row_num,User_Name,User_Email,User_Phone,To_UserName,To_Context from TChristmaxWish where Is_Del=0 )as newTable where row_num between @intStrIndex and @intEndIndex;
select count(id) from TChristmaxWish where Is_Del=0
富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com
暂无评论...
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。