Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: INTELLISENSE with a Custom Templated Control


Message #1 by "Eric Anderson" <eanderson@m...> on Fri, 2 Aug 2002 18:11:55
Good afternoon -

I've recently been writing a lot of templated server controls for my team 
to use.

They work great and do exactly what I want.

BUT

I can't get the VS.NET Intellisense to recognize my custom Attributes or 
the Template tags under the control. I don't get any intellisense help 
inside the control, worse, template tags get flagged with the little red 
underline thingy and intellisense says "The active schema does not support 
the element <template element>"

Example (proper @REGISTER line is in place):

<aoe:aoeframe id="AOEFrame1" runat="server" FrameType="HomePage">
	<PromoBar>
           HAVE A NICE DAY !
	</PromoBar>
</aoe:aoeframe>


In this case, the opening <PromoBar> tag gets flagged as unsupported by 
the active schema. And once the <aoe:aoeframe...> tag is opened, 
intellisense is gone inside it until I close it. Note that FRAMETYPE is a 
custom attribute. The attributes of AOEFRAME and the template items 
(Promobar, etc) are not recognized. 

However, these are merely WARNINGs and the page does compile and run 
flawlessly. This is an issue of making this easier for my team to use.

Here is some of the code that defines the Custom Control:

<ToolboxItem(False)> _
Public Class AOEFrameContainer
    ...
End Class

<ParseChildren(True), ToolboxData("<{0}:AOEFrame runat=server 
frametype=homepage></{0}:AOEFrame>"), Browsable(True)> Public Class 
AOEFrame
    Inherits WebControl
    Implements INamingContainer
...
<Category("Templates"), TemplateContainer(GetType(AOEFrameContainer))> 
Public Property PromoBar() As ITemplate
        Get
            Return mPromoBar
        End Get
        Set(ByVal Value As ITemplate)
            mPromoBar = Value
        End Set
    End Property
...
End Class

Any and all help is much appreciated. Thanks!



  Return to Index