【问题标题】:ASP.net nuget AJAX toolkit auto complete page methodASP.net nuget AJAX 工具包自动完成页面方法
【发布时间】:2017-02-27 06:20:33
【问题描述】:

已安装 nuget AJAX 工具包并在 TextBox1 中放置自动完成扩展程序,但 TextBox 智能标记菜单未显示添加 AutoCompleteExtender 页面方法选项。

我可以在后面的代码中手动键入 AutoCompleteExtender 页面方法,它工作正常,但我的问题是如何像点击智能标签选项一样自动添加?

VS 2015 Community TextBox Smart tag screen

【问题讨论】:

  • 重新启动 Visual Studio 通常可以为我解决这些类型的问题。
  • @Vicky_Thinking 谢谢我已经这样做了,但没有显示。

标签: asp.net ajax nuget


【解决方案1】:

ASP.NET AJAX 功能要求 System.Web.Extensions 程序集安装在托管 Web 应用程序的服务器的全局程序集缓存 (GAC) 中。如果程序集可用,您的应用程序和 App_Code 文件夹或程序集 Bin 文件夹中的任何关联控件都可以使用 AJAX 功能。

使用以下代码确定全局程序集缓存中是否安装了 ASP.NET AJAX。 C#

Private static readonly object ReflectionLock = new object();
Lock (ReflectionLock)
{
    Type scriptManagerType =
       Type.GetType(
       "System.Web.UI.ScriptManager, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35",
       false);
    if (scriptManagerType != null)
        // ASP.NET AJAX is installed.
    else
        // ASP.NET AJAX is not installed.
}

即使为 Web 应用程序启用了 ASP.NET AJAX 功能,您也可能必须检查是否为单个页面启用了 AJAX 功能。

ScriptManager sm = ScriptManager.GetCurrent(Page)
if (sm == null)
{
    // ASP.NET AJAX functionality is not enabled for the page.
}
else
{
    // AJAX functionality is enabled for the page.
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多