在这里我有一个下拉选择“创建新”选项。当用户选择“新建”时,它应该显示模态弹出窗口。基于下拉选择显示模式弹出窗口
这是下拉代码
<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