我刚刚升级从.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:
更改的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的问题
发布评论