gpt4 book ai didi

javascript - ajaxcontroltoolkit JavaScript错误: Microsoft JScript runtime error: 'AjaxControlToolkit' is undefined

转载 作者:行者123 更新时间:2023-11-28 02:29:09 27 4
gpt4 key购买 nike

我正在尝试在客户端 JavaScript 中操作 ajaxcontroltoolkit 选项卡容器。我找到了以下示例代码:

<script type="text/javascript">
var i = 3;
function createnew() {


CreateNewTabPanel('TabContainer1', 'TabPanel' + i, 'TabPanel' + i, 'TabPanel' + i);
i++;




}


function CreateNewTabPanel(tabContainerID, tabPanelID, headerText, bodyText) {
//create header
var header = document.createElement('span');
header.id = "__tab_" + tabContainerID + tabPanelID;
header.innerHTML = headerText;
$get(tabContainerID + "_header").appendChild(header);


//create content
var body = document.createElement('div');
body.id = tabContainerID + "_" + tabPanelID;
body.style.display = "none";
body.style.visibility = "hidden";
body.innerHTML = bodyText;
body.cssClass = "ajax__tab_panel";
$get(tabContainerID + "_body").appendChild(body);




$create(AjaxControlToolkit.TabPanel, { "headerTab": $get(header.id) }, null, { "owner": tabContainerID }, $get(body.id));




}




</script>
<body>
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager runat="Server" EnablePartialRendering="true" ID="ScriptManager1" />
<span id="mes"></span><br />
<span id="mes1"></span>
<ajaxToolkit:TabContainer runat="server" ID="TabContainer1" >
<ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="TabPanel1">
<HeaderTemplate>
TabPanel1
</HeaderTemplate>
<ContentTemplate>
TabPanel1
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="server" ID="TabPanel2" HeaderText="TabPanel2">
<ContentTemplate>
TabPanel2
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>


<input type="button" onclick="createnew()" value="create a new pane" />


</form>
</body>

当我在网络表单中使用它时,出现以下错误

Microsoft JScript 运行时错误:“AjaxControlToolkit”未定义

错误发生在这一行:

$create(AjaxControlToolkit.TabPanel, { "headerTab": $get(header.id) }, null, { "owner": tabContainerID }, $get(body.id)); 

我安装了控制工具包,但我不知道我需要做什么才能访问 js 运行时库。我需要下载源代码并引用 js 文件,还是需要任何其他先决条件?非常感谢任何帮助

谢谢

保罗

最佳答案

最终这是因为微软将类名更改为Sys.Extended.UI.TabPanel。不过还是谢谢你的帖子

$create(Sys.Extended.UI.TabPanel, { "headerTab": _spanTab, "ownerID": tabContainerID, "wasLoadedOnce": false }, null, { "owner": tabContainerID }, body); //$get(body.id));

关于javascript - ajaxcontroltoolkit JavaScript错误: Microsoft JScript runtime error: 'AjaxControlToolkit' is undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14461643/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com