zoukankan      html  css  js  c++  java
  • 给AspNetPager分页控件添加bootstrap样式

     AspNetPager分页控件算是比较好用的一个分页控件了。想要结合bootstrap使用,官方代码入口

    .pagination a[disabled]{  color: #777;cursor: not-allowed;background-color: #fff;border-color: #ddd;}
    .pagination span.active{z-index: 2;color: #fff;cursor: default;background-color: #337ab7;border-color: #337ab7;}
    
     <nav class="pull-right">
            <webdiyer:AspNetPager ID="dpUsedTemplate" runat="server" OnPageChanged="dpUsedTemplate_PageChanged"
                CssClass="pagination" LayoutType="Ul" PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active" PageSize="10">
            </webdiyer:AspNetPager>
        </nav>
    

      

    发现问题:当数据总数超过30时,会自动出现两个控件,官方说明

    解决方案1:

      给两个自动多出来的控件加样式

    .pagination input[type=text] {  50px !important; display: inline-block; }
    .pagination input[type=submit] { margin-left: 10px; }
    

      

     <nav class="pull-right">
            <webdiyer:AspNetPager ID="dpUsedTemplate" runat="server" OnPageChanged="dpUsedTemplate_PageChanged"
                CssClass="pagination" LayoutType="Ul" PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active" PageSize="10" PageIndexBoxClass="form-control" SubmitButtonClass="btn btn-primary">
            </webdiyer:AspNetPager>
        </nav>
    

      

    解决方案二:

      让控件永不多出来

       <nav class="pull-right">
            <webdiyer:AspNetPager ID="dpUsedTemplate" runat="server" OnPageChanged="dpUsedTemplate_PageChanged"
                CssClass="pagination" LayoutType="Ul" PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active" PageSize="10" ShowPageIndexBox="Never">
            </webdiyer:AspNetPager>
        </nav>
    

      

    欢迎大家多多交流
  • 相关阅读:
    这4点微不足道的改变,正在带我起飞
    “挑三拣四”地学一学Java I/O
    做到这3点,你也能成为一个高情商的人
    深入浅出一下Java的HashMap
    前端学习 -- Css -- 有序列表和无序列表
    Python 文件I/O
    python 模块
    python 函数
    Python 日期和时间
    python 字典
  • 原文地址:https://www.cnblogs.com/shihao316558512/p/5580839.html
Copyright © 2011-2022 走看看