AJAX's TabContainer gives an error

A

AAaron123

I add the following code, just as a test, to a master content aspx file that
contains a

SlideShowExtender and a DataList element.

I get the following error :



The Controls collection cannot be modified because the control contains code
blocks (i.e. <% ... %>).



It's such a sweeping restriction that I wonder if I'm doing something wrong
or if there is a way around it.

Is it true that with the TabContainer one can not use any data binding?



Does it apply to things like <%@ Page and <%@ Register




What control's collection is being modified?





<div style="border:solid 3px red">


<cc1:TabContainer ID="TabContainer2" runat="server" ActiveTabIndex="0"
ScrollBars="Auto" Width="211px">

<cc1:TabPanel ID="TabPanelaa" runat="server" HeaderText="TabPanel1">

<ContentTemplate>

This is Home page

<br />


</ContentTemplate>

<HeaderTemplate>

Home

</HeaderTemplate>

</cc1:TabPanel>

<cc1:TabPanel ID="TabPanelbb" runat="server" HeaderText="TabPanel2">

<ContentTemplate>

This is About us page <br />


</ContentTemplate>

<HeaderTemplate>

AboutUs

</HeaderTemplate>

</cc1:TabPanel>

<cc1:TabPanel ID="TabPanelcc" runat="server" HeaderText="TabPanel3">

<ContentTemplate>

This is contact page

<br />


</ContentTemplate>

<HeaderTemplate>

Contact Us

</HeaderTemplate>

</cc1:TabPanel>

</cc1:TabContainer>



</div>
 
A

Alexey Smirnov

I add the following code, just as a test, to a master content aspx file that
contains a

SlideShowExtender and a DataList element.

I get the following error :

The Controls collection cannot be modified because the control contains code
blocks (i.e. <% ... %>).

It's such a sweeping restriction that I wonder if I'm doing something wrong
or if there is a way around it.

Is it true that  with the TabContainer one can not use any data binding?

Does it apply to things like <%@ Page and  <%@ Register

What control's collection is being modified?

<div style="border:solid 3px red">

<cc1:TabContainer ID="TabContainer2" runat="server" ActiveTabIndex="0"
ScrollBars="Auto" Width="211px">

<cc1:TabPanel ID="TabPanelaa" runat="server" HeaderText="TabPanel1">

<ContentTemplate>

This is Home page

<br />

</ContentTemplate>

<HeaderTemplate>

Home

</HeaderTemplate>

</cc1:TabPanel>

<cc1:TabPanel ID="TabPanelbb" runat="server" HeaderText="TabPanel2">

<ContentTemplate>

This is About us page <br />

</ContentTemplate>

<HeaderTemplate>

AboutUs

</HeaderTemplate>

</cc1:TabPanel>

<cc1:TabPanel ID="TabPanelcc" runat="server" HeaderText="TabPanel3">

<ContentTemplate>

This is contact page

<br />

</ContentTemplate>

<HeaderTemplate>

Contact Us

</HeaderTemplate>

</cc1:TabPanel>

</cc1:TabContainer>

</div>

I don't see where you have a <% %> block, but perhaps it is because of
the following reason:

http://www.romsteady.net/blog/2007/08/workaround-controls-collection-cannot..html

Try to put it to the Placeholder Control, hope this helps
 

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

Top