• gentle做的分页控件


    1、自己定义控件本身
      1using System;
      2using System.Collections.Generic;
      3using System.Text;
      4using System.Web.UI;
      5using System.Web.UI.WebControls;
      6using System.Web.UI.HtmlControls;
      7using System.Drawing;
      8using System.Collections;
      9using System.Collections.Specialized;
     10using System.ComponentModel;
     11using System.Data;
     12
     13using 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
     29namespace 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();
    }
  • 相关阅读:
    ng-深度学习-课程笔记-1: 介绍深度学习(Week1)
    java发送http请求和多线程
    Spring Cloud Eureka注册中心(快速搭建)
    Spring boot集成Swagger2,并配置多个扫描路径,添加swagger-ui-layer
    springboot在idea的RunDashboard如何显示出来
    Oracle 中select XX_id_seq.nextval from dual 什么意思呢?
    mysql类似to_char()to_date()函数mysql日期和字符相互转换方法date_f
    MySQL的Limit详解
    HikariCP 个人实例
    NBA-2018骑士季后赛
  • 原文地址:https://www.cnblogs.com/freeliver54/p/637995.html
Copyright © 2020-2023  润新知