Lost HTML intelliisense within ASP. NET Ajax controls

Source: Internet
Author: User
Source: scottgu's blog

Symptom:

You are using ASP. net Ajax beta1 or beta2, and create. ASPX page that is based on. master File. you add the <asp: scriptmanger>, <asp: updatepanel>, <asp: updateprogress> or <asp: timer> control into the content page, and find that markup intelliisense 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-squigugly lines underneath them. you also won't get tag completion when you type these elements in the document. youCanStill compile and run just fine, and the WYSIWYG designer works just fine. But you do lose source editor intelliisense.

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 the 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 intelliisense engine when doing the ASP. NET Ajax beta1 release-which is that you lose intelliisense when you map multiple assemblies against the <asp:> tag prefixAndUse the controls within a <asp: content> Control in A. ASPX page based on a master page.

How to fix this

The fix for the intelliisense issue will be in V. S. 2005 SP1.

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

1) Keep. master file open within the Visual Studio ide when working on. aspx content page. it turns out the intelliisense engine only runs into issues if. 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 intelliisense:

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 intelliisense for the ASP. net Ajax control elements and no intelliisense errors.

AlternativelyYou cocould 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:

<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 intelliisense. The issue shoshould then be resolved completely with VS 2005 SP1.

Hope this helps (and sorry for the inconvenience ),

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.