在我的应用程序中,我有一个ListView,它显示了几个不同列的数据。我想让用户灵活地选择他们想要在ListView中看到的列。所以在我的页面中,我添加了以下内容
<div class="ibox-content">
<div id="modal-form" class="modal fade" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-12 b-r">
<h3 class="m-t-none m-b">Choose Columns</h3>
<p>Move columns from Available to Selected List box to show in the list below</p>
<div class="form-group col-md-4">
<label class="control-label-custom" for="lblAvailableColumns">Available Columns</label>
<asp:ListBox class="form-control" Style="height: 150px;" ClientIDMode="Static" ID="lbAvailableColumns" runat="server" placeholder="AvailableColumns" SelectionMode="Multiple"></asp:ListBox>
</div>
<div style="margin-left: 20px; margin-right: 10px; margin-top: 45px; margin-bottom: 5px" class="form-group col-md-1">
<input type="button" class="btn btn-default" id="left" value="<" />
<input type="button" class="btn btn-default" style="margin-top: 10px;" id="right" value=">" />
</div>
<div class="form-group col-md-4">
<label class="control-label-custom" for="lblSelectedColumns">Selected Columns</label>
<asp:ListBox class="form-control" Style="height: 150px;" ID="lbSelectedColumns" runat="server" placeholder="SelectedColumns" SelectionMode="Multiple"></asp:ListBox>
</div>
<div style="text-align: left;" class="form-group col-md-8">
<asp:LinkButton ID="lnkBtnApplyChooseColumns" TabIndex="4" runat="server" CausesValidation="false" class="btn btn-success" OnClick="lnkBtnApplyChooseColumns_Click">
<i class="glyphicon glyphicon-ok icon-white"></i> Apply </asp:LinkButton>
</div>
</div>
</div>
</div>
</div>
</div>
这就是这样推出的
<a data-toggle="modal" class="btn btn-primary" href="../#modal-form"><i class="glyphicon glyphicon-th"></i>Choose Columns</a>
跑步时看起来像这样
虽然按下“应用”按钮时,我在代码隐藏文件中的lbSelectedColumns列表框中看不到更新的选择。我在这里做错了什么?
P.S:我认为,因为我在显示这个选择列作为使用href的模态对话框,这就是导致问题的原因。任何解决方案??