Ajaxcontroltoolkit 15.1.2 TabContainer的问题

编程入门 行业动态 更新时间:2024-10-15 16:22:35
本文介绍了Ajaxcontroltoolkit 15.1.2 TabContainer的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚刚升级从.NET 3.5的传统Web应用程序到.NET 4.5。该应用程序广泛使用了 AjaxControlToolkit 。由于新版本可从的 2015年5月的,我也对它进行升级。

I've just upgraded a legacy web application from .NET 3.5 to .NET 4.5. The application extensively used the AjaxControlToolkit. Since a new version is available from May 2015, I also upgrade it.

我收到了一些错误,所以我想从头开始创建一个空的项目,添加 AjaxControlToolkit 通过的NuGet,似乎这个问题是由 TabContainer的控制。

I received several errors so I tried to create an empty project from scratch, adding the AjaxControlToolkit through Nuget, and it seems the problem is caused by the TabContainer control.

我收到下面的图像显示的错误:

I receive the errors shown in the images below:

SCRIPT1028:预期标识符,字符串或数字

SCRIPT1028: Expected identifier, string or number

0x800a139e - JavaScript的运行时错误:Sys.ArgumentUndefinedException:值不能是未定义

0x800a139e - JavaScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined.

这些错误后,显然有页面没有TabContainer的。

Obviously after those error there's no TabContainer in the page.

奇怪的是,它只是发生在Internet Explorer 9+。它的工作原理就像在Firefox和Chrome魅力

该应用程序几乎是空的,这里是从页面的相关code:

The application is nearly empty, here's the relevant code from the page:

<asp:ScriptManager ID="sm" runat="server"> </asp:ScriptManager> <ajaxToolkit:TabContainer ID="tc" runat="server"> <ajaxToolkit:TabPanel ID="tp1" runat="server"> <HeaderTemplate> Header </HeaderTemplate> <ContentTemplate> Content </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer>

任何想法?

推荐答案

看来你的包含使用的捆绑的得到它的工作。

It seems that you have to use Bundling to get it work.

在我一直在使用添加了AjaxControlToolkit 15.1.2参考的问题提到的项目的的NuGet 的

In the project mentioned in the question I have added the AjaxControlToolkit 15.1.2 reference using nuget.

要解决我已经启用捆绑作为的 codePLEX :

To solve the problem I have enabled bundling as explained on CodePlex:

  • 使用添加引用 AjaxControlToolkit.StaticResources 的的NuGet 的
  • 更改的ScriptManager 为以下内容: <asp:ScriptManager runat="server"> <Scripts> <asp:ScriptReference Path="~/Scripts/AjaxControlToolkit/Bundle" /> </Scripts> </asp:ScriptManager>

  • 添加以下到&LT; HEAD&GT; 元素:

    <asp:PlaceHolder runat="server"> <%: System.Web.Optimization.Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %> </asp:PlaceHolder>

  • 确保您在 web.config中有这样:

    <ajaxControlToolkit useStaticResources="true" renderStyleLinks="false" />

  • 更多推荐

    Ajaxcontroltoolkit 15.1.2 TabContainer的问题

    本文发布于:2023-11-24 23:53:13,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1627431.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:Ajaxcontroltoolkit   TabContainer

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!