原文出处:ScottGu's Blog

Symptom:

You are using ASP.NET AJAX Beta1 or Beta2, and create a .aspx page that is based on a .master file.  You add the <asp:scriptmanger>, <asp:updatepanel>, <asp:updateprogress> or <asp:timer> control into the content page, and find that markup intellisense no longer works for these controls, or for any controls nested within them:

In the screen-shot above notice how the ScriptManager, UpdatePanel and ContentTemplate tags have the little red-squiggly lines underneath them.  You also won't get tag completion when you type these elements in the document.  You can still compile and run just fine, and the WYSIWYG designer works just fine.  But you do lose source editor intellisense.

Some Background on the Issue:

ASP.NET 2.0 added support for registering controls (both compiled and .ascx user controls) within your web.config file - removing the need to always add <%@ Register %> directives at the top of your page.  For more details on this and to see a sample in action, please check out my Tips and Tricks talk from the recent ASP.NET Connections conference.

One of the cool aspects of this feature is that it also now allows you to map the same tag prefix against multiple assemblies.  We use this with ASP.NET AJAX to have these controls use the <asp:> tag prefix, even though they live in a separate assembly from the system.web.dll file that contains the rest of ASP.NET.

Unfortunately we discovered a bug with the VS markup intellisense engine when doing the ASP.NET AJAX Beta1 release - which is that you lose intellisense when you map multiple assemblies against the <asp:> tag prefix and use the controls within a <asp:content> control in a .aspx page based on a master page.

How to Fix This

The fix for the intellisense issue will be in VS 2005 SP1.

In the meantime there are two workarounds that you can use to fix it immediately:

1) Keep the .master file open within the Visual Studio IDE when working on the .aspx content page.  It turns out the intellisense engine only runs into issues if the .master file is closed.  As long as it is open within the same IDE, it resolves the assemblies just fine and will give you full intellisense:

The screen-shot above is with the exact same sample as the previous screen-shot.  The only difference is that I also have the Site.Master file open in the editor in the background.  When that file is open, I get full intellisense for the ASP.NET AJAX control elements and no intellisense errors.

Alternatively you could instead use the below technique if you don't want to keep the .master file open:

2) Go into your web.config file and change the tag-prefix naming for the ASP.NET AJAX controls to something other than <asp:>.  For example, instead of:

<controls>
        <add tagPrefix="asp" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions" />
        <add tagPrefix="asp" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions" />
      </controls>

change them to something like this:

<controls>
        <add tagPrefix="ajax" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions" />
        <add tagPrefix="ajax" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions" />
      </controls>

You'd then want to update your tag prefixes in your .aspx page to use this new tag prefix.

Either of these approaches will solve the problem and deliver full intellisense.  The issue should then be resolved completely with VS 2005 SP1.

Hope this helps (and sorry for the inconvenience),

Scott

转载于:https://www.cnblogs.com/scgw/archive/2006/11/19/564948.html

Lost HTML Intellisense within ASP.NET AJAX Controls相关推荐

  1. asp.net ajax scriptmanager,ASP.NET: ScriptManager Enables AJAX In Your Web Apps | Microsoft Docs

    10/02/2019 閱讀時間 28 分鐘 本文內容 ASP.NET ScriptManager Enables AJAX In Your Web Apps Ben Rush This article ...

  2. ASP.NET AJAX环境的简单构建(ZT)

    1 概述 Microsoft ASP.NET AJAX 是 Microsoft 公司对 Ajax 技术的完美封装.它能使你已快速的创建包含丰富用户体验的用户界面的 Web 页面,提供加入了跨浏览器的 ...

  3. ASP.NET AJAX入门系列(1):概述

    经常关注我的Blog的朋友可能注意到了,在我Blog的左边系列文章中,已经移除了对Atlas学习手记系列文章的推荐,因为随着ASP.NET AJAX 1.0 Beta版的发布,它们已经不再适用,为了不 ...

  4. [翻译]ASP.NET AJAX与SharePoint的集成

    原文: Integrating ASP.NET AJAX with SharePoint 来自微软SharePoint Team Blog Microsoft ASP.NET AJAX 1.0: 一点 ...

  5. 从Atlas到Microsoft ASP.NET AJAX(4) - Browser Compatibility

    Browser Compatibility 在CTP版本中使用为解决浏览器兼容问题提供了一个抽象层,将功能集中到了IE浏览器的使用方式上.在服务器端如果发现客户端使用的不是IE浏览器,则会立即添加一个 ...

  6. ExtAspNet应用技巧(三) - 302与Asp.Net Ajax

    问题描述: mgzhenhong网友提到这样的问题,并给出了示例: 1. Web.config启用Forms Authentication. <authentication mode=" ...

  7. 1月4日链接篇:ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, IIS7

    [原文地址]Jan 4th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, IIS7 [原文发表日期] Friday, Januar ...

  8. 初学 ASP.NET AJAX (一):构建 ASP.NET AJAX 开发环境

    1 概述 Microsoft ASP.NET AJAX 是 Microsoft 公司对 Ajax 技术的完美封装.它能使你已快速的创建包含丰富用户体验的用户界面的 Web 页面,提供加入了跨浏览器的 ...

  9. Asp.Net Ajax的两种基本开发模式

    Asp.Net Ajax的两种基本开发模式 引言 最近花了一些时间,将微软Asp.Net官方的Ajax视频全部看了一遍,地址是http://www.asp.net/learn/ajax-videos/ ...

最新文章

  1. 【洛谷 P3469】[POI2008]BLO-Blockade(割点)
  2. 数据中心供配电系统负荷计算实例分析
  3. androidstudio自动生成变量_使Eclipse或AndroidStudio的代码模板自动生成类名和方法名...
  4. 【POJ - 2186】Popular Cows (Tarjan缩点)
  5. python 片段_python片段程序
  6. 经典面试题(13):如何理解和应用JavaScript闭包?
  7. linux修改登录密码门,Linux更改用户密码
  8. java 符_java运算符
  9. matlab 模拟电磁学时域有限差分法,MATLAB模拟的电磁学时域有限差分法
  10. Halcon union_adjacent_contours_xld详解
  11. 前端实现AWS s3亚马逊云储存上传资源
  12. PC端浏览器模拟微信浏览器环境
  13. Python基础教程(第三版)
  14. AMIGO小清新资讯(GBK+UTF)DZ仿flyme模板
  15. epublib java_java中使用Epublib解析EPub文件
  16. 网站运营中活动组织的三项注意
  17. wifi找不到路由器可能的排查
  18. login-shell和non login-shell区别 & bash配置文件实验报告
  19. 【锁机制】MySQL锁机制
  20. 模型压缩工具Distiller-剪枝

热门文章

  1. Spring Boot笔记-通过反射获取Spring Boot中的Bean(反射调用Service)
  2. staf工作笔记-使用stax并行处理获取其他主机操作系统信息
  3. pycharm断点调试django
  4. 文字 竖排居中_学会了这几招,瞬间就搞定PPT文字排版问题!
  5. linux pidof用法,科技常识:Linux pidof命令使用总结
  6. java设置等待锁的时间_java的锁池和等待池
  7. Simplex 单纯形算法的python实现
  8. (计算机组成原理)第七章输入和输出系统-第二节1:外部设备之输入和输出设备(键盘鼠标、显示器和打印机)
  9. 2-3:套接字(Socket)编程之UDP通信,sockaddr,sockaddr_in,recvfrom,sendto
  10. python中列表 字典 元祖 enumerate()函数