在這裏我有一個下拉選擇「創建新」選項。當用戶選擇「新建」時,它應該顯示模態彈出窗口。基於下拉選擇顯示模式彈出窗口
這是下拉代碼
<asp:DropDownList ID="DropDownConfigFile" runat="server" CssClass="selectpicker">
<asp:ListItem Text="Create New" Value="1" ></asp:ListItem>
</asp:DropDownList>
這是jQuery的打開彈出窗口,
<script type="text/javascript">
$(function() {
//Attach click event to your Dropdownlist
$("#DropDownConfigFile").change(function() {
//Get the selected valu of dropdownlist
selection = $(this).val();
//If its one then show the dialog window. You can change this condition as per your need
if (selection == 1) {
//Show the modal window
$('#myModal').modal('show');
}
});
});
</script>
這是我的模態彈出式設計。
<div id="myModal" class="modal fade">
<asp:Panel ID="Panel1" runat="server" align="center" style = "display:contents ">
<table class="table table-hover small-text" id="tb" border="1">
<thead>
<tr>
<%--<td class="col-md-4">Index Position</td>--%>
<th style="BACKGROUND-COLOR: DarkGrey ">Index Position</th>
<th style="BACKGROUND-COLOR: DarkGrey ">Alpha-Numeric Scramble</th>
<th style="BACKGROUND-COLOR: DarkGrey ">Packed-Decimal Scramble</th>
<%--<td class="col-md-4">Type of Scramble</td>
<td class="col-md-4">Scrambling Required</td>--%>
</tr>
</thead>
</div>
但不幸的是,如果我選擇「新建」,它不會打開一個彈出窗口。這裏有什麼問題。
謝謝先生。現在工作正常。 – kiran
@kiran很高興幫助.. –
嗨,先生,每件事情都很好,但它顯示完整的窗口。我想減少彈出窗口的大小。有沒有機會減小窗口的大小。 – kiran