Twitter中的引导按钮显示在ASP中

我注意到Twitter Bootstrap中的ASP页面中存在按钮问题。 似乎唯一正确出现的类是“btn”类。 如果我想使用“btn btn-primary”,我的蓝色按钮上会出现一个灰色渐变。 当我将鼠标悬停在按钮上时,它的一半会变成蓝色。 我用其他按钮样式尝试过,并得到相同的结果。

我希望下面的代码是正确的:

<asp:button type="button" id="btnSearch" runat="server" CssClass="btn btn-primary" Text="Search"></asp:button> 

完整的HTML

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="header.aspx.vb" Inherits="Backend.header" %>

<!DOCTYPE html>

<html>
<head runat="server">
<title></title>


<link rel="stylesheet" href="css/bootstrap.css" />
<link rel="stylesheet" href="css/bootstrap-responsive.css" />
<link rel="stylesheet" href="css/custom.css" />

</head>
<body>
<form id="masterSearch" runat="server">
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
          <div class="container">
              <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
              </a>

              <a class="brand" href="#">Company Name</a>

              <div class="nav-collapse collapse">
                  <ul class="nav">
                      <li><a href="cart.aspx">
                          <asp:Label ID="Label1" runat="server" Text="Cart"> </asp:Label></a></li>
                      <li class="dropdown">
                          <a href="#" class="dropdown-toggle" data-toggle="dropdown">History <b class="caret"></b></a>
                          <ul class="dropdown-menu">
                              <li><a href="#">New Order</a></li>
                              <li><a href="#">Order History</a></li>
                          </ul>
                      </li>
                      <li><a href="#">Invoices</a></li>
                      <li class="dropdown">
                          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Returns <b class="caret"></b></a>
                          <ul class="dropdown-menu">
                              <li><a href="#">Return Previous Order</a></li>
                              <li><a href="#">Return Policy</a></li>
                          </ul>
                      </li>
                      <li><a href="#">Rewards Balance</a></li>
                      <li><a href="#">Help</a></li>
                      <li><a href="#">Log Out</a></li>
                  </ul>
              </div>
          </div>
      </div>
    </div>

    <div id="wrap">
            <div class="row-fluid">

         <div class="container">

             <div class="span12">
                 <asp:Label ID="Label1" class="pull-right" runat="server" Text="Label"></asp:Label>
              </div>

       </div> <!--/container-->
   </div> <!--/row-->

    <hr />

    <div class="container">
        <div class="row-fluid">
            <div class="span2">Left Column</div><!--/left sidebar-->

            <div class="span8">
                <h5 class="pagination-centered">Search By...</h5>
                <div class="span12">

                        <input type="text" id="txtSearch1" placeholder="NDC#, Item#, Item Name..." runat="server" />
                        <asp:button type="button" id="btnSearch" runat="server" CssClass="btn btn-primary" Text="Search"></asp:button>       


                </div> <!--/search-->

                <div class="searchResults">
                    <table ID="tblSearchResults" class="table table-bordered">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
                             <Columns>


                                       <asp:BoundField HeaderText="Generic" DataField="ItemDesc" />
                                       <asp:BoundField HeaderText="Brand" DataField="BrandName" />
                                        <asp:BoundField HeaderText="Item Number" DataField="ItemNumber" />
                                        <asp:BoundField HeaderText="NDC" DataField="NDC" />
                                       <asp:BoundField HeaderText="Class" DataField="ControlLevel" />
                                        <asp:BoundField HeaderText="Price" DataField="Price" />
                                        <asp:TemplateField HeaderText="Qty">




                    <ItemTemplate>
                        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                    </ItemTemplate>
                </asp:TemplateField>
                             </Columns>
        </asp:GridView> 


                </table>

                </div>


            </div><!--/main content -->

            <div class="span2">Right Column</div><!--/right sidebar-->
        </div><!--/row-->

    </div> <!--/container -->












     <asp:button type="button" id="btnAdd" class=" btn btn-danger" runat="server" Text="Add to Cart"></asp:button> 
&nbsp;&nbsp;
    <asp:Button ID="btnCheckOut" runat="server" Text="Check Out" />






    </form>
   </body>
  </html>

我不一定记得100%,但考虑到这一点之后,我想我碰到了和你一样的东西。 在查看我的一些旧代码时,我使用链接按钮而不是Button控件来解决此问题。

<asp:LinkButton CssClass="btn btn-small" runat="server" ID="m_ReportButton" OnClick="OnReportClick" Text="Report" />
<asp:LinkButton CssClass="btn btn-small" runat="server" ID="m_DeleteButton" OnClick="OnDeleteClick" Text="Delete" />
<asp:LinkButton CssClass="btn btn-small" runat="server" ID="m_EditButton" OnClick="OnEditClick" Text="Edit" />
<asp:LinkButton CssClass="btn btn-small" runat="server" ID="m_QuoteButton" OnClick="OnQuoteClick" Text="Quote" />
<asp:LinkButton CssClass="btn btn-small" runat="server" ID="m_ReplyButton" OnClick="OnReplyClick" Text="Reply" />

回想起来,我几乎可以肯定,我做了这个改变,仅仅是为了应用btn bootstrap类。

链接地址: http://www.djcxy.com/p/75963.html

上一篇: Twitter Bootstrap Button Display In ASP

下一篇: HTML5 Boilerplate and Twitter Bootstrap