gentle做的分页控件

56 篇文章 0 订阅
11 篇文章 0 订阅
1、自己定义控件本身
  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
// /判断当前页
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();
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值