基本上我有一个带有 runat 服务器标签的表单。在这个表单中,我有一个 asp 转发器和一个提交按钮——但我也想有一个按钮,它会在我的代码中调用 ac# 方法——有人可以给我一个关于如何去做的想法吗?同样在此代码中,即使它的自动回发值为 true,也不会触发 selectindexchanged 事件,这很奇怪:/
谢谢
编辑 OK 解决方案似乎是删除操作选项卡,然后我通过一些 JavaScript 设置属性:) 为什么事情不能简单明了
<form action="broadcast.aspx" id="bcForm" runat="server" onsubmit="chkChecks()">
<a class="btn btn-warning" href="#" title="Create new product"> <i class="icon-plus icon-white"></i> Create new product</a>     <a id="bcItems" data-toggle="modal" class="btn btn-primary" title="Broadcast" onclick="chkItems()"><i class="icon-share icon-white"></i> Broadcast</a>
</br></br>
<p>Filters:
<asp:DropDownList ID="groupFilter" runat="server" ToolTip="Groups" AutoPostBack="True" onselectedindexchanged="groupFilter_SelectedIndexChanged1" ></asp:DropDownList></p>
<div>
<asp:Repeater ID="DepartmentList" runat="server" OnItemmDataBound="DepartmentsList_ItemDataBound">
<HeaderTemplate>
<table id="grouptable" class="table table-bordered table-striped sortable">
<thead>
<tr>
<th class="sorttable_nosort" >Broadcast
<br> </br><a class="label label-inverse" onclick="checkAll()">Check All</a> <a class="label label-inverse" onclick="uncheckAll()">Uncheck All</a></th>
<th class="sorttable_numeric">ID</th>
<th>Name</th>
<th>Last Modified</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td WIDTH="100">
<input type="checkbox" name="BroadcastSelect[]" value="<%# Eval("DEPT_ID") %>"</input></td>
<td>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("DEPT_ID") %>'></asp:Label></td>
<td><%# Eval("DESC") %></td>
<td>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("CHG_DATE") %>'></asp:Label></td>
<td><a class="btn btn-info" href="<%# Eval("gURL") %>">Edit</a>  <asp:HyperLink ID="HyperLink1" runat="server" CssClass="btn btn-danger">Broadcast Now</asp:HyperLink></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div id="myModal" class="modal hide fade" runat="server">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">× Select A Branch</h3>
</div>
<div class="modal-body">
<h4>Test</h4>
<asp:Repeater ID="cfgList" runat="server">
<HeaderTemplate>
<table id="configtable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Broadcast</th>
<th>Branch No.</th>
<th>Branch Name</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<input type="checkbox" name="BranchSelection[]" value="<%# Eval("branch") %>"</input></td>
<td><%# Eval("branch") %></td>
<td><%# Eval("name") %></a> </td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<div class="modal-footer">
<!--<a class="btn btn-success" onclick="document.getElementById('bcForm').submit()" title="Broadcast"><i class="icon-share icon-white"></i> Broadcast</a> -->
<a class="btn btn-success" onclick="chkBranches()" title="Broadcast"><i class="icon-share icon-white"></i> Broadcast</a>
<!--<input type="submit" value="Broadcast3" class="btn btn-success"/> -->
<div id="myDiv"></div>
</div>
</div>
<!-- <a data-toggle="modal" href="#myModal" class="btn btn-primary">Broadcast Testing</a> -->
<!--<a class="btn btn-success" onclick="document.getElementById('bcForm').submit()" title="Broadcast"><i class="icon-share icon-white"></i> Broadcast</a>-->
<a id="bcItems2" data-toggle="modal" class="btn btn-primary" title="Broadcast" onclick="chkItems()"><i class="icon-share icon-white"></i> Broadcast</a>
<ul class="pager">
<li>
<asp:Button ID="previousBtn" runat="server" Text="Prev" cssclass="search-query"
Width="80px"/>
</li>
<li>
<asp:Button ID="nextBtn" runat="server" Text="Next" cssclass="search-query"
Width="80px"/>
</li>
</ul>
</form>