在不更改 ID 的情况下在服务器上运行
本文关键字:服务器 运行 情况下 ID | 更新日期: 2023-09-27 18:32:49
有没有办法在不导致 id 更改的情况下将元素设置为runat="server"
?
我有一个母版页和一个内容页。此内容页面中有一个 id 为 id="fulllist_list_table"
的表。如果我将runat="server"
应用于tbl
元素,则 id 将变为id="ctl00_content_fulllist_list_table
.我宁愿改变不发生。
有没有办法让上述方案不更改表元素的 id?
代码如下。
目录
<%@ Page Language="C#" MasterPageFile="master.master" Inherits="DenApp.fulllist" Title="DenApp - Full List"%>
<asp:content ID="contentInternal" contentplaceholderid="content" runat="server">
<script type="text/javascript">
$(document).ready(function () {
$("#master_tabs_div_fulllist").removeClass("master_tabs_links");
$("#master_tabs_div_fulllist_div").removeClass("master_tabs_tabs");
$("#master_tabs_div_fulllist_div").addClass("master_tabs_selected");
$("#fulllist_list_table").tablesorter({
widgets: ["zebra", "filter"],
widgetOptions: {
filter_childRows: false,
filter_columnFilter: true,
filter_ignoreCase: true,
filter_liveSearch: true,
filter_searchDelay: 100,
filter_startsWith: true,
}
});
$("#fulllist_list_table").tablesorterPager({
container: $("#fulllist_paging_div"),
size: 25,
output: '{startRow}-{endRow}/{totalRows}',
cssNext: '#fulllist_paging_div_nextbtn',
cssPrev: '#fulllist_paging_div_prevbtn',
cssFirst: '#fulllist_paging_div_firstbtn',
cssLast: '#fulllist_paging_div_lastbtn',
cssPageSize: '#fulllist_paging_div_pagesize',
});
});
</script>
<link rel="Stylesheet" href="./css/fulllist.css" />
<div id="master_content_wrapper">
<div id="fulllist_list_div">
<table id="fulllist_list_table" class="tablesorter" runat="server" clientidmode="Static">
<thead>
<tr>
<th>Account Number</th>
<th>Patient Name</th>
<th>Plan Code</th>
<th>Carrier</th>
<th>Billed Patient Type</th>
<th>Initial Patient Type</th>
<th>Denial Code</th>
<th>Denial Reason</th>
<th>Admit Date</th>
<th>Discharge Date</th>
<th>Appeal Amount</th>
<th>Total Charges</th>
<th>Received Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>C0000000000</td>
<td>Smith, John T</td>
<td>000000</td>
<td>Insurance</td>
<td>PT</td>
<td>PT</td>
<td>0000</td>
<td>Denied</td>
<td>01/01/01</td>
<td>01/01/01</td>
<td>$100.00</td>
<td>$100.00</td>
<td>01/04/01</td>
</tr>
<tr>
<td>C0000000001</td>
<td>Rita, John T</td>
<td>000001</td>
<td>Insurance</td>
<td>PT</td>
<td>PT</td>
<td>0000</td>
<td>Denied</td>
<td>02/01/01</td>
<td>01/02/01</td>
<td>$200.00</td>
<td>$1,000,000.00</td>
<td>01/04/01</td>
</tr>
</tbody>
</table>
</div>
<div id="fulllist_paging_div">
<div id="fulllist_paging_div_firstbtn" class="fulllist_tablenav">
</div>
<div id="fulllist_paging_div_prevbtn" class="fulllist_tablenav">
</div>
<div id="fulllist_paging_div_numpages_div" >
<select id="fulllist_paging_div_pagesize">
<option value="10">10</option>
<option selected="selected" value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="200">200</option>
</select>
</div>
<div id="fulllist_paging_div_pagedisplay" class="pagedisplay">
</div>
<div id="fulllist_paging_div_nextbtn" class="fulllist_tablenav">
</div>
<div id="fulllist_paging_div_lastbtn" class="fulllist_tablenav">
</div>
</div>
</div>
</asp:content>
将 ClientIDMode 设置为 Static
to table 元素。
<table id="fulllist_list_table" runat="server" clientidmode="Static">
正如您在评论中提到的,您正在使用.Net 2.0
框架,所以我想告诉您,不幸的是,ClientIDMode
在framework 4.0
之前不可用。查看此处的此更改
旧版本的值为 Auto
.