gentle做的分页控件
1、自己定义控件本身
///判断当前页
function fn_Check(currpage,allpages,flg){
currpage=parseInt(currpage.value.trim());
allpages=parseInt(allpages);
switch(flg){
case "F":
if(currpage==1){
alert("It is the first page");
return false;
}else{
return true;
}
break;
case "P":
if(currpage-1<=1){
alert("It is the first page");
return false;
}else{
return true;
}
break;
case "L":
if(currpage>=allpages){
alert("It is the last page");
return false;
}else{
return true;
}
break;
case "N":
if(currpage+1>=allpages){
alert("It is the last page");
return false;
}else{
return true;
}
break;
case "G":
if(currpage>allpages||currpage<1){
alert("No page");
return false;
}else{
return true;
}
break;
}
return true;
}
3、Calendar.css
.button
{
/*参考button样式--huiqin*/
FILTER: progid:DXImageTransform.Microsoft.Gradient(startColorStr='white', endColorStr='aliceblue', gradientType='0');
COLOR: #333333;
FONT-FAMILY: verdana;
FONT-SIZE: 9pt;
border: 1px solid aliceblue;
}
.textbox
{
background:#ffffff;
border-bottom-color:#CCCCCC;
border-bottom-width:1px;
border-top-width:1px;
border-left-width:1px;
border-right-width:1px;
/*color:Gray;*/
text-decoration:none;/*文本样式*/
word-spacing:inherit;/*字间距离*/
font-size: 10pt; font-style:normal;
font-family:"宋体,Tahoma";bottom:0px;
height: 15px;/*文本框高度*/
width:30px;/*文本框宽度*/
line-height: normal
}
4、测试,调用
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.PagerCtl.Sql = " select * from dbo.m_Units ";
this.GridView1.DataSource = this.PagerCtl.DataSource;
this.GridView1.DataBind();
}
}
protected void PagerCtl_btnClick(object sender, EventArgs e)
{
this.GridView1.DataSource = this.PagerCtl.DataSource;
this.GridView1.DataBind();
}
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using System.Web.UI;
5
using System.Web.UI.WebControls;
6
using System.Web.UI.HtmlControls;
7
using System.Drawing;
8
using System.Collections;
9
using System.Collections.Specialized;
10
using System.ComponentModel;
11
using System.Data;
12
13
using Gentle.Framework;
14
/// -----------------------------------------------------------------------------
15
/// Project : CtrolBox
16
/// Class : PagerCtl///
17
/// -----------------------------------------------------------------------------
18
/// <summary>
19
/// gentle分页
20
/// </summary>
21
/// <remarks>
22
/// </remarks>
23
/// <history>
24
/// xx. YYYY/MM/DD VER AUTHOR COMMENTS
25
/// 1. 2007/2/2 1.00 susan CREATE
26
/// </history>
27
/// -----------------------------------------------------------------------------
28
29
namespace CtrolBox
30
{
31
[assembly: WebResource(CtrolBox.PagerCtl.CSSResName, "text/css")]
32
[assembly: WebResource(CtrolBox.PagerCtl.JSResName, "text/javascript")]
33
34
public class PagerCtl: WebControl, INamingContainer, IPostBackDataHandler
35
{
36
内部属性
49
50
属性
117
118
公开事件
199
200
内部function
230
231
实现
402
}
403
}
404
2、Calendar.js
using System;2
using System.Collections.Generic;3
using System.Text;4
using System.Web.UI;5
using System.Web.UI.WebControls;6
using System.Web.UI.HtmlControls;7
using System.Drawing;8
using System.Collections;9
using System.Collections.Specialized;10
using System.ComponentModel;11
using System.Data;12

13
using Gentle.Framework;14
/// -----------------------------------------------------------------------------15
/// Project : CtrolBox16
/// Class : PagerCtl/// 17
/// -----------------------------------------------------------------------------18
/// <summary>19
/// gentle分页20
/// </summary>21
/// <remarks>22
/// </remarks>23
/// <history>24
/// xx. YYYY/MM/DD VER AUTHOR COMMENTS 25
/// 1. 2007/2/2 1.00 susan CREATE26
/// </history>27
/// -----------------------------------------------------------------------------28

29
namespace CtrolBox30
{31
[assembly: WebResource(CtrolBox.PagerCtl.CSSResName, "text/css")]32
[assembly: WebResource(CtrolBox.PagerCtl.JSResName, "text/javascript")]33

34
public class PagerCtl: WebControl, INamingContainer, IPostBackDataHandler35
{36
内部属性49

50
属性117

118
公开事件199

200
内部function230

231
实现402
}403
}404

///判断当前页
function fn_Check(currpage,allpages,flg){
currpage=parseInt(currpage.value.trim());
allpages=parseInt(allpages);
switch(flg){
case "F":
if(currpage==1){
alert("It is the first page");
return false;
}else{
return true;
}
break;
case "P":
if(currpage-1<=1){
alert("It is the first page");
return false;
}else{
return true;
}
break;
case "L":
if(currpage>=allpages){
alert("It is the last page");
return false;
}else{
return true;
}
break;
case "N":
if(currpage+1>=allpages){
alert("It is the last page");
return false;
}else{
return true;
}
break;
case "G":
if(currpage>allpages||currpage<1){
alert("No page");
return false;
}else{
return true;
}
break;
}
return true;
}
.button
{
/*参考button样式--huiqin*/
FILTER: progid:DXImageTransform.Microsoft.Gradient(startColorStr='white', endColorStr='aliceblue', gradientType='0');
COLOR: #333333;
FONT-FAMILY: verdana;
FONT-SIZE: 9pt;
border: 1px solid aliceblue;
}
.textbox
{
background:#ffffff;
border-bottom-color:#CCCCCC;
border-bottom-width:1px;
border-top-width:1px;
border-left-width:1px;
border-right-width:1px;
/*color:Gray;*/
text-decoration:none;/*文本样式*/
word-spacing:inherit;/*字间距离*/
font-size: 10pt; font-style:normal;
font-family:"宋体,Tahoma";bottom:0px;
height: 15px;/*文本框高度*/
width:30px;/*文本框宽度*/
line-height: normal
}
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.PagerCtl.Sql = " select * from dbo.m_Units ";
this.GridView1.DataSource = this.PagerCtl.DataSource;
this.GridView1.DataBind();
}
}
protected void PagerCtl_btnClick(object sender, EventArgs e)
{
this.GridView1.DataSource = this.PagerCtl.DataSource;
this.GridView1.DataBind();
}
posted on 2007-02-02 12:57 freeliver54 阅读(844) 评论(5) 收藏 举报


浙公网安备 33010602011771号