【问题标题】:AjaxControlToolkit does not work for pages using MasterPageAjaxControlToolkit 不适用于使用 MasterPage 的页面
【发布时间】:2013-07-15 02:12:42
【问题描述】:

我一直在尝试让 AjaxControlToolkit(从 NuGet 下载)版本 7.0607 来处理使用母版页但没有运气的 Web 表单。 运行 DotNet 4.5 MasterPage 上有 ToolkitScriptManager,但它不会传递给子页面。

我可以创建一个独立的 aspx 页面,在页面上放置一个 scriptmanager 并且控件工作正常,所以我认为缺少一个设置。

完成这项工作的程序是什么?

母版页脚本块是这样的:

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="AjaxControlToolkit" Name="ExtenderBase.BaseScripts.js" />
            <asp:ScriptReference Assembly="AjaxControlToolkit" Name="Common.Common.js" />
            <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>
    </ajaxToolkit:ToolkitScriptManager>

【问题讨论】:

  • 显示母版页的标记
  • Yuriy 所说的——我从来没有遇到过无法从孩子访问母版页上的 ToolkitScriptManager 的问题。
  • 这是标题: 抱歉 - 没有空间发布整个页面。
  • 我会尝试创建另一个临时项目 - 这可能是 MS 启动模板中的另一个错误(有很多)。

标签: ajax master-pages ajaxcontroltoolkit asp.net-4.5


【解决方案1】:

没有错误,只是来自另一个论坛的糟糕建议。 以下几行是罪魁祸首 - 任何一个都搞砸了:

<asp:ScriptReference Assembly="AjaxControlToolkit" Name="ExtenderBase.BaseScripts.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit" Name="Common.Common.js" />

【讨论】:

    【解决方案2】:

    用工具包脚本管理器替换 Microsoft 脚本管理器对我来说是成功的,他们正在工作。

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    

    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager> 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-17
      • 1970-01-01
      • 2023-03-20
      • 2018-02-15
      • 2021-08-01
      • 2015-02-18
      • 1970-01-01
      相关资源
      最近更新 更多