twitter bootstrap工具提示我有工作,但只要有
<asp:RequiredFieldValidator ID="rfvAmount"
runat="server"
ControlToValidate="txtAmount"
ErrorMessage="This is a required field.">
</asp:RequiredFieldValidator>
在页面上,工具提示不起作用。
如果我注释掉验证器,则工具提示有效。想法?
以下是带有表单验证的工具提示。
<asp:TextBox ID="txtAmount" runat="server" ValidationGroup="rfvAmount">
</asp:TextBox>
<asp:RequiredFieldValidator ID="rfvAmount" runat="server"
ControlToValidate="txtAmount" ErrorMessage="This is a required field.">
</asp:RequiredFieldValidator>
<asp:Button ID="btnSend" runat="server" Text="Send" class="btn btn-success" data-
placement="right" rel="tooltip" data-original-title="Send Info"/>
答案 0 :(得分:0)
我遇到了与ASP.NET验证器相同的问题。要解决此冲突,请将Bootstrap引用放在页面底部。这样它将在ASP.NET控件加载后加载。
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<%--your ASP.NET validators will load here--%>
</div>
<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script>
$(document).ready(function (){
doYourStaff();
});
</script>
</body>
</html>