【问题标题】:How to bind the count of total rows of a table in to a bootstrap badge?如何将表的总行数绑定到引导徽章?
【发布时间】:2016-03-08 14:29:12
【问题描述】:

是否可以将“数字”绑定到引导徽章。 'number' 是使用从 dbo.table_name 中选择 count(*) 从 Sql 服务器检索的

到目前为止,我有按钮,当我单击它时,我会在警告框中获得表格的总行数。我想使用引导程序徽章,每次加载页面时,这个徽章是否可能包含总行数。

【问题讨论】:

    标签: asp.net sql-server twitter-bootstrap badge


    【解决方案1】:

    带A标签:

     <a href="#">News <span class="badge">5</span></a><br>
    

    带按钮:

    <button type="button" class="btn btn-primary">Primary <span class="badge">5</span></button>
    

    只需将你的结果替换为 5。这非常容易和可能。
    通过页面加载事件,您可以在加载页面时获取数字。

    【讨论】:

      【解决方案2】:

      你将拥有

      HTML

      <asp:Label runat='server' id='lblcount' class='label label-default'/>
      

      在 Cs 中

      lblcount.Text =//value from the DB
      

      所以引导徽章类被赋予标签 更多详情请参考this link

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-03-30
        • 1970-01-01
        • 2017-08-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-21
        相关资源
        最近更新 更多