2014-03-31 64 views
0

我为张贴的这些另外一个道歉,但我已经尝试了获取AjaxControlToolkit工作的所有方法,我试过的方法添加这在web.configtoolkitscriptmanager.cs没有找到

<pages> 
    <controls> 
     <add tagPrefix="asp" 
       namespace="AjaxControlToolkit" 
       assembly="AjaxControlToolkit" /> 
    </controls> 
</pages> 

但随后口口声声说,我只能使用ScriptManager的一个实例(我确信它删除

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> 

)。 但是我仍然得到相同的错误。我试过它只是在

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> 

但它说它找不到toolkitscriptmanager.cs。有谁知道发生了什么事。我在ASP.NET Webform中执行此操作。

回答

0

发现问题,因为在母版页中有一个scriptmanager,如果你把它放在web.config中。

<pages> 
<controls> 
    <add tagPrefix="asp" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" /> 
</controls> 
</pages> 

它会告诉你,你有2个脚本管理器的实例。因此,你AVE修改的ScriptManager在主文件到:

<ajaxToolkit:ToolkitScriptManager runat="server"> 
<Scripts> 
    <asp:ScriptReference Name="jquery" /> 
    <asp:ScriptReference Name="jquery.ui.combined" /> 
    <asp:ScriptReference Name="WebForms.js" Path="~/Scripts/WebForms/WebForms.js" /> 
    <asp:ScriptReference Name="WebUIValidation.js" Path="~/Scripts/WebForms/WebUIValidation.js" /> 
    <asp:ScriptReference Name="MenuStandards.js" Path="~/Scripts/WebForms/MenuStandards.js" /> 
    <asp:ScriptReference Name="GridView.js" Path="~/Scripts/WebForms/GridView.js" /> 
    <asp:ScriptReference Name="DetailsView.js" Path="~/Scripts/WebForms/DetailsView.js" /> 
    <asp:ScriptReference Name="TreeView.js" Path="~/Scripts/WebForms/TreeView.js" /> 
    <asp:ScriptReference Name="WebParts.js" Path="~/Scripts/WebForms/WebParts.js" /> 
    <asp:ScriptReference Name="Focus.js" Path="~/Scripts/WebForms/Focus.js" /> 
    <asp:ScriptReference Name="WebFormsBundle" /> 
</Scripts> 

这应停止错误。