Monday, December 8, 2008

TabContainer cannot have children of type.....

Recently, I encountered the problem quite similiar to the one above.....
TabContainer cannot have children of type
'System.Web.UI.WebControls.Repeater'

to be precise...

I googled quite a bit for this error, but could not find much about it.. No wonders.. It was a careless mistake that I had made. Here is the control that caused this issue....

<cc1:tabcontainer id="tabToolbox" runat="server">
<cc1:tabpanel id="pnl" headertext="Most Popular">
<contenttemplate>
<asp:repeater id="rptMostPopular" runat="server">
<itemtemplate>
<asp:linkbutton id="lnkPopular" runat="server" text=""></asp:linkbutton>
</itemtemplate>
</asp:repeater>
</contenttemplate>
</cc1:tabpanel>
<cc1:tabpanel id="pnl2" headertext="Most Viewed">
<contenttemplate>
<asp:repeater id="rptMostViewed" runat="server">
<itemtemplate>
<asp:linkbutton id="lnkPopular" runat="server" text="">&jt;/asp:linkbutton>
</itemtemplate>
</asp:repeater>
</contenttemplate>
</cc1:tabpanel>
<cc1:tabpanel id="pnl3" headertext="Most Emailed">
<contenttemplate>
<asp:repeater id="rptMostEmailed" runat="server">
<itemtemplate>
<asp:linkbutton id="lnkPopular" runat="server" text=""></asp:linkbutton>
</itemtemplate>
</asp:repeater>
</contenttemplate>
</cc1:tabpanel>
</cc1:tabcontainer>

Well...... A very simple reason for getting this error, even on the designer and also at runtime..
I FORGOT THE TAG "RUNAT=SERVER" WHILE DESCRIBING THE TAB PANELS AND therefore could not get the tab-panels to be server side...

This is what raised the issue.

A simple addition of RUNAT=SERVER solves the issue...


Hope this would help someone in need... :)

--Ashutosh

17 comments:

  1. Thanks - solved my problem

    ReplyDelete
  2. Happy to know that it helped. :)

    ReplyDelete
  3. Anonymous04:39

    Ah, I missed it on one panel too, thanks

    ReplyDelete
  4. Anonymous01:27

    thanks a lot. you saved me for a lot of headache.

    ReplyDelete
  5. Anonymous00:08

    Your post saved me some digging ! Thanks

    ReplyDelete
  6. thanks, woked for me. :)

    ReplyDelete
  7. Anonymous14:03

    Yes it worked for me too. Thanks!

    ReplyDelete
  8. Anonymous04:53

    Thanks spent a few hours digging until I came accross your blog. Thanks so much! -Erick

    ReplyDelete
  9. Anonymous07:29

    Your not the only one to make this mistake. Thanks for posting it. Solved my problem too!

    ReplyDelete
  10. ridiculous error message - thanks though

    ReplyDelete
  11. Yeah typing too fast, and forgot those 'important' properties. Nice post - thanks!

    ReplyDelete
  12. Anonymous00:07

    Thanks. it saved my two hours :)

    ReplyDelete
  13. Anonymous17:40

    thanks .... you helped me indeed :)

    ReplyDelete
  14. Anonymous22:17

    No matter how many times I implement a tab control I ALWAYS forget the panels themselves require those parameters.

    Many thanks!

    ReplyDelete
  15. Anonymous20:55

    thanks! this solved my problem

    ReplyDelete
  16. Anonymous22:03

    Thanks, it saved my time.

    ReplyDelete