给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] { width: 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>

  

转载于:https://www.cnblogs.com/shihao316558512/p/5580839.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值