Updating TabPanel contents asynchronously

W

Wazzamatazz

Hi folks,

I've been trying to work out how to asynchronously update the contents
of a TabPanel using an UpdatePanel and I can't for the life of me get
it to work. I've seen a couple of examples online that declare an
UpdatePanel inside a TabPanel, but I get an error when I try and do
something like the following:

<ajax:TabContainer runat="server" ID="TabList" ActiveTabIndex="0">
<ajax:TabPanel ID="ContentTab1" HeaderText="Tab 1">
<ContentTemplate>
<asp:UpdatePanel runat="server" ID="AsyncContent1"
UpdateMode="Conditional">
<ContentTemplate>
<!-- Some content here -->
<asp:Button runat="server" ID="UpdateButton"
OnClick="UpdateButton_Click" Text="Update" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>

The error I get is, "TabContainer cannot have children of type
'System.Web.UI.UpdatePanel'.". Looking at the code for the
TabContainer class, I can see that the AddParsedSubObject method
throws an HttpException if the control being parsed is not a TabPanel
or a LiteralControl. Am I missing something crucial here, or is it
simply not possible to asynchronously update the contents of a
TabPanel and the examples I have seen are in fact completely wrong?

Thanks in advance for any help that you can give me!
 
W

Wazzamatazz

Hmmm. I've just noticed that it was because I forgot to put
runat="server" in my TabPanel. Oops!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top