Ajaxcontroltoolkit 15.1.2 TabContainer的问题 [英] Ajaxcontroltoolkit 15.1.2 Tabcontainer problems

查看:486
本文介绍了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,似乎这个问题是由<$ C $所致C> 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:


  1. 使用添加引用 AjaxControlToolkit.StaticResources 的NuGet

  2. 更改的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的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆