日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > asp.net >内容正文

asp.net

Lost HTML Intellisense within ASP.NET AJAX Controls

發(fā)布時(shí)間:2025/3/15 asp.net 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Lost HTML Intellisense within ASP.NET AJAX Controls 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
原文出處: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

轉(zhuǎn)載于:https://www.cnblogs.com/scgw/archive/2006/11/19/564948.html

總結(jié)

以上是生活随笔為你收集整理的Lost HTML Intellisense within ASP.NET AJAX Controls的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。