gpt4 book ai didi

asp.net - 在 ASP 中显示 Twitter Bootstrap 按钮

转载 作者:太空宇宙 更新时间:2023-11-04 15:05:23 24 4
gpt4 key购买 nike

我注意到我在 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%,但在仔细考虑之后,我想我遇到了和你完全一样的事情。在查看我的一些旧代码时,我通过使用链接按钮而不是按钮控件来解决这个问题。

<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 类。

关于asp.net - 在 ASP 中显示 Twitter Bootstrap 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15953106/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com