自己开发的一款基于PagedDataSource的datalist repeater控件,只需要在源程序中添加三行代码,即可实现通用分页

由DataGrid翻页所导致的诸多问题的解决方案         前些日子在公司的一个项目中,要用到DataGrid自带的删除功能,并且实现分页,原以为很简单的,但却偏偏困扰了我们组的所有人!每当删除一条记录后要退回到前一页时,便出现了“无效的 CurrentPageIndex 值。它必须大于等于 0 且小于 PageCount。”错误。单步调试并跟踪进去,方才发现,问题出在了DataGrid.DataBind();的时候。我调了一下DataBi 阅读详情

第一步:

在使用到自定义分页的后台代码中添加以下三行

 protected void Page_Load(object sender, EventArgs e)
      { 
        UIShareMethods.InitPds(DbHelper.GetDataSet("select * from a1User").DataSet, 10, DataList1);
          if (!Page.IsPostBack)
          {
              DataList1.DataSource = UIShareMethods.Pds;
              DataList1.DataBind();
          }
     }

 

第二步:

在自定义公共类UIShareMethods中添加以下代码:

  public static PagedDataSource Pds;
    public static DataList datlst;

    /// <summary>
    /// 初始化控件PagedDataSource
    /// </summary>
    /// <param name="ds">所在页面需要翻页的datalist对应dataset</param>
    /// <param name="pagesize">所在页面包含的记录数目</param>
    /// <param name="dl">所在页面需要翻页的datalist</param>

    public static void InitPds(DataSet ds,int pagesize,DataList dl)
    {
       
        Pds = new PagedDataSource();
        Pds.DataSource = ds.Tables[0].DefaultView;
        Pds.AllowPaging = true;
        Pds.PageSize = pagesize;
        datlst = dl;
    }

 

第三步:

创建自定义控件:dalistPager.ascx

代码如下:

1)dalistPager.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="dalistPager.ascx.cs" Inherits="dalistPager" %>
<table style=" width:50%; font-size:small; text-decoration:none">
    <tr>
        <td nowrap="nowrap">
            <asp:LinkButton ID="lbFirst" runat="server" onclick="lbFirst_Click">第一页</asp:LinkButton>
        </td>
        <td nowrap="nowrap">
            <asp:LinkButton ID="lbPrev" runat="server" onclick="lbPrev_Click">上一页</asp:LinkButton>
        </td>
        <td nowrap="nowrap">
            <asp:LinkButton ID="lbNext" runat="server" onclick="lbNext_Click">下一页</asp:LinkButton>
        </td>
        <td nowrap="nowrap">
            <asp:LinkButton ID="lbLast" runat="server" onclick="lbLast_Click">最后一页</asp:LinkButton>
        </td>
        <td nowrap="nowrap">
            第<asp:Label ID="lblCurrentPage" runat="server"></asp:Label>
            页/共<asp:Label ID="lblPageCount" runat="server"></asp:Label>
            页</td>
        <td nowrap="nowrap">
            <asp:TextBox ID="txtPageNum" runat="server" Width="27px"></asp:TextBox>
            <asp:LinkButton ID="lbGo" runat="server" onclick="lbGo_Click">Go</asp:LinkButton>
        </td>
    </tr>
</table>
<p>
     </p>

2)dalistPager.ascx.cs

public partial class dalistPager : System.Web.UI.UserControl
{
    static int currentpageindex=0;
    protected void Page_Load(object sender, EventArgs e)
    {
        lblPageCount.Text = UIShareMethods.Pds.PageCount.ToString();
        lblCurrentPage.Text = (currentpageindex+1).ToString();
        btnState();
    }


    protected void lbFirst_Click(object sender, EventArgs e)
    {
        UIShareMethods.Pds.CurrentPageIndex = currentpageindex;
        if (UIShareMethods.Pds.CurrentPageIndex >= 0)
        {
            UIShareMethods.Pds.CurrentPageIndex = 0;
            currentpageindex = 0;
            //lblCurrentPage.Text = currentpageindex.ToString();
            UIShareMethods.datlst.DataSource = UIShareMethods.Pds;
            UIShareMethods.datlst.DataBind();          
        }
        else
        {
            return;
        }
        

    }

    
    protected void lbPrev_Click(object sender, EventArgs e)
    {
        UIShareMethods.Pds.CurrentPageIndex = currentpageindex;
        if (UIShareMethods.Pds.CurrentPageIndex > 0)
        {
            currentpageindex=--(UIShareMethods.Pds.CurrentPageIndex);
            //lblCurrentPage.Text = currentpageindex.ToString();
            UIShareMethods.datlst.DataSource = UIShareMethods.Pds;
            UIShareMethods.datlst.DataBind();
        }
        else
        {
            return;
        }
    }
    protected void lbNext_Click(object sender, EventArgs e)
    {
        UIShareMethods.Pds.CurrentPageIndex = currentpageindex;
        if (UIShareMethods.Pds.CurrentPageIndex < UIShareMethods.Pds.PageCount-1)
        {
           currentpageindex=++( UIShareMethods.Pds.CurrentPageIndex);
           //lblCurrentPage.Text = currentpageindex.ToString();
            UIShareMethods.datlst.DataSource = UIShareMethods.Pds;
            UIShareMethods.datlst.DataBind();      
        }
        else
        {
            return;
        }
    }
    protected void lbLast_Click(object sender, EventArgs e)
    {
        UIShareMethods.Pds.CurrentPageIndex = currentpageindex;
        if (UIShareMethods.Pds.CurrentPageIndex < UIShareMethods.Pds.PageCount - 1)
        {
            UIShareMethods.Pds.CurrentPageIndex = UIShareMethods.Pds.PageCount - 1;
            currentpageindex = UIShareMethods.Pds.PageCount - 1;
            //lblCurrentPage.Text = currentpageindex.ToString();
            UIShareMethods.datlst.DataSource = UIShareMethods.Pds;
            UIShareMethods.datlst.DataBind();          
        }
        else
        {
            return;
        }
    }
    protected void lbGo_Click(object sender, EventArgs e)
    {
        UIShareMethods.Pds.CurrentPageIndex = int.Parse(txtPageNum.Text)-1;
        currentpageindex = int.Parse(txtPageNum.Text)-1;
        //lblCurrentPage.Text = txtPageNum.Text;
        UIShareMethods.datlst.DataSource = UIShareMethods.Pds;
        UIShareMethods.datlst.DataBind();
    }

    protected void btnState()
    {
        if (currentpageindex==0)
        {
             lbFirst.Enabled = false;
            lbPrev.Enabled = false;
            lbNext.Enabled = true;
            lbLast.Enabled = true;
        }
        else if (currentpageindex==UIShareMethods.Pds.PageCount - 1)
        {
             lbFirst.Enabled = true;
            lbPrev.Enabled = true;
            lbNext.Enabled = false;
            lbLast.Enabled = false;
        }
        else
        {
            lbFirst.Enabled = true;
            lbPrev.Enabled = true;
            lbNext.Enabled = true;
            lbLast.Enabled = true;
        }
        
    }
}

 

 

第四步:

将自定义控件拖放到第一步中页面中的datalist的<footertemplate></footertemplate>中

 

 

 

 

Node-Red系列教程——NodeRed通过OPC UA读取数据并写入mysql NodeRed通opcua读取西门子数据并存入mysql 阅读详情

相关推荐

在昇腾910B服务上部署搭建适配PDF解析工具Mineru2.5开源项目

本文介绍了在昇腾910B服务器上部署开源PDF解析工具Mineru2.5的过程。首先从昇腾社区下载mindie镜像并运行容器,安装系统依赖。针对部署过程中遇到的多个报错问题(如torchvision与torch版本不匹配、昇腾软件栈与NumPy 2.0不兼容等),提供了具体解决方案和兼容版本。通过设置环境变量、安装指定版本的Python依赖包,成功部署Mineru项目并下载模型。最后运行测试,验证了在NPU设备上运行pipeline的可行性。整个过程详细记录了版本适配和错误处理方法,为类似部署场景提供了参考

一起加油吧 2164

PHP三维生成,php 三维饼图的实现代码

php 三维饼图的实现代码发布于 2014-10-01 12:20:01 | 134 次阅读 | 评论: 0 | 来源: 网友投递PHP开源脚本语言PHP(外文名: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,入门门槛较低,易于学习,使用广泛,主要适用于Web开发领域。PHP的文件后缀名为php。本文...

weixin_32259417的博客 484

南邮 2024 软件安全 实验四 自动脱壳+手动脱壳

这次这个实验很简单,就是一个简单的脱壳,然后进行爆破就行了,解法非常的多这里不多讲,会简单讲一下特殊情况这个点开是这样子:然后放进peid里面查看,我这个是原版的PEid,所以显示出来是这样:会显示nothing found,但其实如果你使用吾爱破解的魔改过的peid,它就会显示具体的壳名:然后你点击右下角的那个箭头,里面会有很多的插件用来自动脱壳:你也可以使用这个通用脱壳器,但是脱壳后的程序无法运行,这个放到后面讲。

ARbing_an的博客 2558

封装的截取高清图的demo~

.h 文件 // // ShareMethods.h // XiaoQiao // // Created by 王小胜 on 17/3/24. // Copyright © 2017年 NingboXiaojiang. All rights reserved. // #import #import @interface ShareMethods : NSObject /

OneCrazyDog的博客 468

椭圆曲线点加的推导公式(一)

椭圆曲线点加推导过程

qq_32100199的博客 1516

[原创]Linux 802.11n CSI tool Monitor模式

Linux 802.11n CSI tool Monitor模式 使用AP模式的缺陷在于ping 命令速度比较慢,且不能精确控制发送的参数,比如接收的包数量是不可控的。Monitor模式可以调制发送速率、发包数量、发送天线个数、HT模式、short/long guard interval等等,因此调通Monitor模式是必须的。期间参考了博主沃一德的CSI Tool安装使用讲解,对他的工作表示感...

u014645508的博客 1万+

ABP vNext 对接 Ant Design Vue 实现分页查询

本文内容ABP vNext中的分页查询STable组件中的分页查询实现参数转换层最终对接效果 在 上一篇 博客中,博主和大家分享了如何在 EF Core 中实现多租户架构。在这一过程中,博主主要参考了 ABP vNext 这个框架。从上个月开始,我个人发起了一个项目,基于 ABP vNext 和 Ant Design Vue 来实现一个通用的后台管理系统,希望以此来推进 DDD 和 Vue 的学习,努力打通前端与后端的“任督二脉”。因此,接下来的这段时间内,我写作的主题将会围绕 ABP vNext 和 An

素履独行 | 元培的个人博客 2711

EDA工具安装第一步:Synopsys Installer的配置与图形化界面使用详解

本文详细解析了EDA工具安装的关键第一步——Synopsys Installer的配置与使用。文章阐述了其作为统一部署管理器和依赖协调者的核心作用,并分步详解了如何通过图形化界面高效安装EDA工具,同时介绍了命令行批处理等进阶技巧,旨在帮助工程师快速搭建稳定的芯片设计环境。

zeta9的博客 340

使用PagedDataSource类实现DataList和Repeater控件的分页显示

     Asp.net提供了三个功能强大的列表控件:DataGrid、DataList和Repeater控件,但其中只有DataGrid控件提供分页功能。相对DataGrid,DataList和Repeater控件具有更高的样式自定义性,所以很多时候我们喜欢使用DataList或Repeater控件来显示数据。 实现DataList或Repeater控件的分页显示有几种方法: 1、写一个

netspy的专栏 1836

.NET 8 组件之IOC容器组件

NET 8中的IOC容器组件继承了前几代的优良传统,并在性能、扩展性、灵活性等方面进行了诸多优化,使得它在现代应用开发中依然保持领先地位。通过合理使用IOC容器,开发者可以更高效地管理依赖关系,编写更加模块化、可维护的代码。随着.NET生态的不断发展,IOC容器将继续扮演关键角色,为开发者提供强大的依赖管理功能。

hy_4377的博客 1528

LPDDR6来了!带你一文看懂它和LPDDR5/5X的差距 + 技术演进逻辑全解析

🧠从速率到架构,从总线宽度到协议设计,LPDDR6 每一个改动都不是拍脑袋做的,它针对的是AI / HPC / 云计算 / 下一代笔记本平台的真实需求。作为工程师的我们,不仅要“用得上”,更要“测得准”,因为没有测试验证,就没有量产落地!🎯LPDDR6不是未来,而是现在进行时!

weixin_43199439的博客 2169

使用PagedDataSource类实现DataList和Repeater控件的分页显示功能

使用PagedDataSource类实现DataList和Repeater控件的分页显示功能    Asp.net提供了三个功能强大的列表控件:DataGrid、DataList和Repeater控件,相对DataGrid,DataList和Repeater控件具有更高的样式自定义性,很多时候我们喜欢使用DataList或Repeater控件来显示数据,但是Repeater和DataList没

ASP和PHP工作经验 842

深入Scrapy ItemLoader:打造优雅高效的Python爬虫数据清洗流水线

ItemLoader是 Scrapy 提供的声明式数据加载工具。它的核心理念是:将数据提取(从response中取原始值)和数据清洗/验证(处理空值、格式转换、默认值等)分离开。你可以把它想象成一个工厂流水线:原始零件(selector提取的文本)进入,经过一道道工序(输入处理器),组装成最终产品(Item字段)。首先在items.py中定义清晰的数据结构。使用搭配类型注释(虽然Scrapy自身不强制,但对人和IDE友好)。

2201_76125261的博客 68

.Net中DataList、Repeater控件实现分页的方法

        Asp.net提供了三个功能强大的列表控件:DataGrid、DataList和Repeater控件,但其中只有DataGrid控件提供分页功能。相对DataGrid,DataList和Repeater控件具有更高的样式自定义性,所以很多时候我们喜欢使用DataList或Repeater控件来显示数据。  实现DataList或Repeater控件的分页显示有几种方法:  1、写一

1938

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

使用PagedDataSource类实现DataList和Repeater控件的分页显示[转]

使用PagedDataSource类实现DataList和Repeater控件的分页显示www.chinacs.net  2004-08-10  中文C#技术站      Asp.net提供了三个功能强大的列表控件:DataGrid、DataList和Repeater控件,但其中只有DataGrid控件提供分页功能。相对DataGrid,DataList和Repeater控

419

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

DataList或Repeater控件的分页

Asp.net提供了三个功能强大的列表控件:DataGrid、DataList和Repeater控件,但其中只有DataGrid控件提供分页功能。相对DataGrid,DataList和Repeater控件具有更高的样式自定义性,所以很多时候我们喜欢使用DataList或Repeater控件来显示数据。      实现DataList或Repeater控件的分页显示有几种方法:  1、写一

liuhuan862495296的专栏 777

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

DataList与PagedDataSource类

  导言 在建立ASP.NET Web应用程序,最常见的任务是显示数据。ASP.NET提供了一个富饶的数据网络控制,使显示数据一件轻而易举的,但最强大的数据网络控制-D ataGrid中-实行某些限制的灵活性奠定了数据在网页上。 最近我发现自己需要一个更灵活的布局比DataGrid中的刚性列/行的方向,所以我决定去与Repeater控件,所以我可以很容易地定制标记排放。  Repe

网站程序设计 787

Datalist控件,Repeater控件如何分页?

Asp.net提供了三个功能强大的列表控件:DataGrid、DataList和Repeater控件,但其中只有DataGrid控件提供分页功能。相对DataGrid,DataList和Repeater控件具有更高的样式自定义性,所以很多时候我们喜欢使用DataList或Repeater控件来显示数据。实现DataList或Repeater控件的分页显示有几种方法:1、写一个方法或存...

aome1470的博客 183

DataList和Repeater数据分页

导言  分页和排序是显示数据时经常用到的功能。比如,在一个在线书店里搜索关于ASP.net 的书的时候,可能结果会是成百上千,而每页只列出十条。而且结果可以根据title(书名),price(价格),page count(页数),author name(作者)等来排序。我们在分页和排序报表数据 里已经讨论过, GridView, DetailsView, 和FormView 都有内置的分页功能

Yao,Mane 790

【Asp.net之旅】--数据绑定控件之DataList

       上篇博客讨论了Repeater控件的基本用法,它是最基本的数据绑定控件,只提供了数据绑定的功能,熟练运用Repeater控件后,其它类似的数据绑定控件就很简单了。接着我们上篇博客的内容继续,今天来讨论下DataList的基本使用方法。 一、绑定控件之DataList        该控件可以以自定义的格式显示各种数据源的字段,其显示数据的格式在创建的模板中定义,可

航帆远洋 3万+

使DataList控件有翻页功能

Asp.net提供了三个功能强大的列表控件:DataGrid、DataList和Repeater控件,但其中只有DataGrid控件提供分页功能。相对DataGrid,DataList和Repeater控件具有更高的样式自定义性,所以很多时候我们喜欢使用DataList或Repeater控件来显示数据。 实现DataList或Repeater控件的分页显示有几种方法: 1、写一个方法或存储过程,根

fzzf 1202

Repeater控件分页

用PagedDataSource类实现Repeater和DataList的分页。 PagedDataSource封装了DataGrid的分页属性,我们可以象DataGrid那样进行分页。HTML代码http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml" >    无

Virtual_MJ的专栏 1720

Repeater控件分页例子

Repeater控件分页例子 日期:2004-2-15 0:01:18 出处:【孟宪会之精彩世界】 作者:孟宪会 Repeater和DataList控件提供了一个快速、灵活的表现数据的方式,但是,它们没有内建的分页功能;DataGrid控件提供了内建的分页功能,但它的结构比较复杂。下面就用PagedDataSource类实现Repeater和DataList的分页。 PagedDataSource

徐虎的专栏 1068
上一篇: 英语从句分类与解析
下一篇: 简单的datalist分页代码
GoodShot
博客等级 码龄22年 968粉丝 281原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值