Intractable: loss of the HTML intelliisense function in ASP. NET Ajax controls

Source: Internet
Author: User

[Original address] Gotcha: Lost HTML intelliisense within ASP. NET Ajax controls
[Original article publication date] Thursday, November 16,200 6 AM

Symptoms:

You are using ASP. net Ajax beta1 or beta2, created based on. one of the master page files. on the ASPX page, you have added the <asp: scriptmanger>, <asp: updatepanel>, <asp: updateprogress>, or <asp: timer> controls to the content page, it is found that in these controls or any controls embedded in them, the intelliisense function of the logo symbol does not work:

In the above section, we noticed that the scriptmanager, updatepanel, and contenttemplate identifiers have red, wavy lines under them. When you type these elements in the document, you cannot automatically complete the identifier. But youStill OKCompilation and running are fine. The WYSIWYG designer still works, but you lose the intelliisense function in the source code editor.

Background Knowledge:

ASP. NET 2.0 added in web. support for registering controls in the config file, whether compiled or. the ascx user control removes the requirement that you always add the <% @ register %> command at the top of the page. If you want to learn more about this, or take a look at an actual example, please refer to the skills and know-how I gave at the ASP. NET connections conference recently.

One cool aspect of this feature is that it now allows you to map multiple sets to the same identifier prefix. In ASP. net Ajax, so that the above controls use the <asp:> identity prefix, although they contain ASP.. web. in other assembly except DLL.

Unfortunately, we are releasing ASP. net Ajax beta1 found a defect in the vs identifier intelliisense engine. The problem is that when you map multiple sets to the same <asp:> identifier prefix,AndWhen you use these controls in <asp: content> of the. aspx Content Page Based on the master page, you will lose the intelliisense function.

How to solve this problem

This problem of intelliisense will be solved in VS 2005 SP1.

At the same time, there are two alternatives that you can fix immediately:

1) when editing the. aspx content webpage, keep the related. master page files open in Visual Studio IDE. It is found that the intelliisense engine is faulty only when the. master file is closed. As long as the file has been opened in the same IDE, it locates the Assembly without any problems and will provide you with the complete intelliisense function:

The above is the same as the previous one. The only difference is that I opened the site. master file at the same time. When the file is opened, I will get the complete intelliisense function of the ASP. NET Ajax control element, without the intelliisense error.

Alternatively, if you do not want to keep the. master file open, you can also use the following method:

2) Go to your web. config file and change the identifier prefix of the ASP. NET Ajax control to something other than <asp:>. For example, replace this:

 

<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>

 

And 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>

Then, you need to update the ID prefix in your. ASPX page to use this new ID prefix.

The above two methods can solve the problem, and you also have the complete intelliisense function. This problem should be completely solved in VS 2005 SP1.

I hope this article will help you, and I am sorry for the inconvenience caused,

Scott

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.