Ajax TabContainer 在回发时间歇性地消失
本文关键字:消失 时间 TabContainer Ajax | 更新日期: 2023-09-27 17:56:26
我正在用 C# ASP.net 开发一个 GIS Web 应用程序(映射)。
我有一个Ajax TabContainer,里面有几个带有桌子的TabPanel。该表包含其他内容,例如地图窗口、比例尺等(均来自 ESRI WebAdf 工具包)。
这是我的表格的精简版本,没有其他内容......
<table id="MainTable>
<tr>
<td>
<ajax:TabContainer runat="server" ActiveTabIndex="0" id="TabContainer" CssClass="ajax__tab_xp">
<ajax:TabPanel runat="server" HeaderText="Online Mapping Service" ID="TabPanel1">
</ajax:TabPanel>
<ajax:TabPanel ID="TabPanel2" runat="server" HeaderText="Postcode">
</ajax:TabPanel>
<ajax:TabPanel ID="TabPanel3" runat="server" HeaderText="Coordinates">
<ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</td>
</tr>
</table>
在运行时回发时,我的选项卡容器有时会消失。此问题不是特定于浏览器的。
到目前为止,我已经尝试过但没有成功...
- 使用 TabContainer 的相对定位设置 Z 索引
包括一个 JQuery 脚本来"显示"TabContainer...
<script type="text/javascript" language="javascript"> $(document).ready(function() { $("#TabContainer").show(); }); </script>
是否可以在后面的代码中包含一些 C#?...
Public void page_Load(object sender, EventArgs e)
{
TabContainer.show()
}
编程新手,并试图弄清楚如何"始终显示"或"始终在顶部"TabContainer。
谢谢
我不确定这是否是由于您在在此处发布代码之前清理了代码,但缺少标签。
aspx 上的代码应如下所示:
<AjaxToolkit:TabContainer ID="TabContainer" runat="server">
<AjaxToolkit:TabPanel ID="TabPanel1" runat="server">
<ContentTemplate>
Your asp/html code goes here
</ContentTemplate>
</AjaxToolkit:TabPanel>
</AjaxToolkit:TabContainer>
好的,整理了这个。AJAX 工具包未回发客户端存在问题...
<script language="javascript" type="text/javascript">
// Solution to sys.invalidoperationexception bug
Sys.Application.initialize = function Sys$_Application$initialize() {
if (!this._initialized && !this._initializing) {
this._initializing = true;
var loadMethodSet = false;
var initializeDelegate = Function.createDelegate(this, this._doInitialize);
if (document.addEventListener) {
loadMethodSet = true;
document.addEventListener("DOMContentLoaded", initializeDelegate, false);
}
if (/WebKit/i.test(navigator.userAgent)) {
loadMethodSet = true;
this._load_timer = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) {
initializeDelegate();
}
}, 10);
}
else {
/*@cc_on@*/
/*@if (@_win32)
loadMethodSet = true;
document.write("<script id=__ie_onload defer src=BLOCKED SCRIPTvoid(0)><'/scr" + "ipt>");
var deferScript = document.getElementById("__ie_onload");
if (deferScript) {
deferScript.onreadystatechange = function() {
if (this.readyState == "complete") {
initializeDelegate();
}
};
}
/*@end@*/
}
// only if no other method will execute initializeDelegate is
// it wired to the window's load method.
if (!loadMethodSet) {
$addHandler(window, "load", initializeDelegate);
}
}
}
Sys.Application._doInitialize = function Sys$_Application$_doInitialize() {
if (this._load_timer !== null) {
clearInterval(this._load_timer);
this._load_timer = null;
}
Sys._Application.callBaseMethod(this, 'initialize');
var handler = this.get_events().getHandler("init");
if (handler) {
this.beginCreateComponents();
handler(this, Sys.EventArgs.Empty);
this.endCreateComponents();
}
this.raiseLoad();
this._initializing = false;
}
Sys.Application._loadHandler = function Sys$_Application$_loadHandler() {
if (this._loadHandlerDelegate) {
Sys.UI.DomEvent.removeHandler(window, "load",
this._loadHandlerDelegate);
this._loadHandlerDelegate = null;
}
this._initializing = true;
this._doInitialize();
}
</script>