By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

Error: Content is not allowed between the opening and closing tags for element

P: n/a
I have a ascx webcontrol that I register with:
%@ Register Src="../Controls/Default/Library/Basket/Basket.ascx"
TagName="Basket"
TagPrefix="uc1" %>

and instantiate on the page with:
<uc1:Basket ID="Basket1" runat="server" />

This works without problems, Now I've added the attribute:
[ParseChildren(ChildrenAsProperties = true)]
to the basket control and added a property called Header of the type
ITemplate.
When I change my basket tag to look like:
<uc1:Basket ID="Basket1" runat="server">
<Header>Myheader</Header>
</uc1:Basket>

I get the following error on the Basket tag:
Error 1 Cannot switch views: Content is not allowed between the opening and
closing tags for element 'Basket'.

And the following error on the Header tag:
Error 2 Validation (XHTML 1.0 Transitional): Element 'header' is not
supported.
When I run the page it works fine.

What am I missing to allow tags inside the Basket controls XML?

Kind Regards,
Allan Ebdrup
Jan 26 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.