我正在使用以下示例 http://www.bootply.com/59864
但是当我点击触发弹出窗口的按钮时,背景变暗但窗口没有显示。知道是什么导致了这个吗?我正在使用bootstrap 3.2.0
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CreateWorkbook.aspx.cs" Inherits="CreateWorkbook" %>
<asp:Content ID="Content0" ContentPlaceHolderID="head" runat="Server">
<script>
$(function () {
$('#myFormSubmit').click(function (e) {
e.preventDefault();
alert($('#myField').val());
/*
$.post('http://path/to/post',
$('#myForm').serialize(),
function(data, status, xhr){
// do something here with response;
});
*/
});
});
</script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="row">
<div class="col-md-12 col-xs-12" style="margin-top: 10px">
<a data-toggle="modal" href="#myModal" role="button" class="btn btn-info btn-lg"><span class="glyphicon glyphicon-plus-sign">
</span>Add questions</a>
</div>
</div>
<div class="list-group col-md-8" style="margin-top:20px"> <a href="#" class="list-group-item active"> Questions list </a> <a href="#" class="list-group-item list-group-item-info">Q1: Name</a> <a href="#" class="list-group-item list-group-item-info">Q2: Location</a> <a href="#" class="list-group-item list-group-item-info">Q3: Outcome</a> <a href="#" class="list-group-item list-group-item-info">Q4: Next meeting date</a> </div>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<form id="myForm" method="post">
<input type="hidden" value="hello" id="myField">
<button id="myFormSubmit" type="submit">Submit</button>
</form>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
</asp:Content>
答案 0 :(得分:3)
工作示例基于Bootstrap 2.3.1,如果要导入Bootstrap 3.3.0,那么一个工作示例可能是:http://bootply.com/va3EnHE0MJ