locked
Tab Page problem RRS feed

  • Question

  • User-962670764 posted

    I have an Ajax tab control with several panels. the tabs are visible and for the first two the content is displayed, but for all the other tabs the content is blank.  In fact, the panel is only one blank line

    TAB container<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="3">
     first tab page displays OK <ajaxToolkit:TabPanel ID="tp1" BackColor="WhiteSmoke" runat="server" style="text-align:center; width:800px; height:auto;" HeaderText="My Profile">
                  
                <ContentTemplate>
    
                    <asp:Panel ID="pnlpro" runat="server" class="profilepanel"  Style="text-align: left;  width:775; height:auto;" HeaderText="My Profile">
                  
                        <asp:UpdatePanel ID="udpprofile" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div style="float: left; width: 320px; margin-right: 20px; margin-left: 25px; margin-top: 20px; background-color: aliceblue; border: solid 1px; border-color: firebrick; border-radius: 5px; padding: 2px">
                                    <asp:FormView ID="fvprofile" runat="server" DataKeyNames="riderid" Width="320">
                                        <HeaderTemplate>
                                            <div id="Div1" runat="server" style="background-color: lightskyblue; border-radius: 5px">
                                                <asp:Image ID="imgicon" runat="server" ImageUrl="~/Images/Site/bdicon.png" />
                                                <asp:Label ID="lblbdtitle" runat="server" Text="My Big Dog Profile" Font-Bold="true" Font-Size="Medium" />
                                            </div>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <table style="width: 320px">
    
                                                <td class="tdrt">
                                                    <asp:Label ID="lbnm" runat="server" Text="Name:"></asp:Label></td>
                                                <td class="tdlt">
                                                    <asp:Label ID="lblrname" runat="server" Text='<%# GetFullName() %>' />
                                                </tr><tr>
                                                    <td class="tdrt">
                                                        <asp:Label ID="Label2" runat="server" Text="Display Name:"></asp:Label></td>
                                                    <td class="tdlt">
                                                        <asp:Label ID="dnameLabel" runat="server" Text='<%# Bind("dname") %>' /></td>
                                                </tr>
                                                <tr>
                                                    <td class="tdrt">
                                                        <asp:Label ID="ld" runat="server" Text="Birthdate:"></asp:Label></td>
                                                    <td class="tdlt">
                                                        <asp:Label ID="lbdob" runat="server" Text='<%# Bind("dob","{0:d}") %>' /></td>
                                                </tr>
                                                <tr>
                                                    <td class="tdrt">
                                                        <asp:Label ID="Label3" runat="server" Text="Gender:"></asp:Label></td>
                                                    <td class="tdlt">
                                                        <asp:Label ID="Label4" runat="server" Text='<%# getSex(Eval("gender").ToString()) %>' /></td>
                                                </tr>
                                                <tr>
                                                    <td class="tdrt">
                                                        <asp:Label ID="Label5" runat="server" Text="Comment:"></asp:Label></td>
                                                    <td class="tdlt">
                                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("comment") %>' /></td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </asp:FormView>
                                    <asp:Button ID="EditButtonPro" runat="server" CausesValidation="False"
                                        CommandName="Edit" Text="Edit My Profile" OnCommand="EditButtonPro_Command" />
    
                                </div>
                              
                                <div style="float: left; width: 320px; margin-right: 20px; margin-left: 45px; margin-top: 20px; 
                                   background-color: aliceblue; border: solid 1px; border-color: firebrick; border-radius: 5px; padding: 2px">
    
                                    <asp:Panel ID="pnlhlp1" runat="server" Style="background-color: aliceblue; font-size: x-small;">
                                        <div style="background-color: lightskyblue; height: 40px; padding: 2px;">
                                            <br />
                                            <asp:Label ID="Label1" runat="server" Text=" Profile Requirements"
                                                Font-Bold="True" Font-Size="Medium" />
    
                                        </div>
                                        <ul>
                                            <li>Name: Your Full Name, made up of your Title, First, Last and Middle Names, and Suffix,
                                  the fields can be edited indivdually when editing your Profile.Omly your First and Middle Names are required.</li>
                                            <li>Display Name: Your online name, defaults to First / Last Name. Required.</li>
                                            <li>Birth and Gender are required.</li>
                                            <li>Comment not required and will display 'No Comment' if blank.</li>
                                        </ul>
    
                                    </asp:Panel>  
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
          
                
                    </ContentTemplate>
                End tab page 1</ajaxToolkit:TabPanel>
          Tab page2 displays ok also
                 <ajaxToolkit:TabPanel ID="tpadd" runat="server" BackColor="AliceBlue" Width="800">
                <HeaderTemplate>
                    <asp:Label ID="Label8" runat="server"  Text="My Address"></asp:Label>
                </HeaderTemplate>
               
                <ContentTemplate>
                    <asp:Panel ID="Panel1" runat="server" Width="800px" Height="300px" CssClass="profilepanel">
                             <div>
    
                             <div style="float: left; width: 320px; margin-right: 20px; margin-left: 25px; margin-top: 20px; background-color: aliceblue; border: solid 1px; border-color: firebrick; border-radius: 5px; padding: 2px">
                                  
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <asp:FormView ID="fvaddress" runat="server" DataKeyNames="riderid" DataSourceID="sqladdress">
                                            <HeaderTemplate>
                                               <div id="dadd" runat="server" style="background-color: lightskyblue; border-radius: 5px">
                                                <asp:Image ID="imgicon" runat="server" ImageUrl="~/Images/Icons/addride.png" />
                                                <asp:Label ID="lblbdtitle" runat="server" Text="My Address" Font-Bold="true" Font-Size="Medium" />
                                            </div>
                                            </HeaderTemplate>
                                            <EditItemTemplate>
    
                                                <asp:HiddenField ID="rideridLabel1" runat="server" Value='<%# Eval("riderid") %>' />
                                                <br />
                                                <table>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tba1" runat="server" Text="Address1:" CssClass="tdrt" /></td>
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="address1TextBox" runat="server" Text='<%# Bind("address1") %>' /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tba2" runat="server" Text="Addess2:" CssClass="labelhdr;" /></td>
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="address2TextBox" runat="server" Text='<%# Bind("address2") %>' /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tbcy" runat="server" Text="City" CssClass="labelhdr;" /></td>
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="cityTextBox" runat="server" Text='<%# Bind("city") %>' /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tbs" runat="server" Text="State:" CssClass="labelhdr;" /></td>
                                                        <td class="tdlt">
                                                            <asp:DropDownList ID="stateidTextDdl" runat="server" Text='<%# Bind("stateid") %>' /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tbcp" runat="server" Text="ZIP/Postal Code:" CssClass="labelhdr;" /></td>
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="postalcodeTextBox" runat="server" Text='<%# Bind("postalcode") %>' /></td>
                                                    </tr>
                                                    <tr>
    
                                                        <td class="tdlt" colspan="2">
    
                                                            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
                                                            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                                    </tr>
                                                </table>
                                            </EditItemTemplate>
    
                                            <ItemTemplate>
                                                <table>
                                                    <tr>
                                                        <td colspan="2">
                                                            <asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("riderid") %>' />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="TextBox1" runat="server" Text="Address1:" CssClass="labelhdr" /></td>
    
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("address1") %>' CssClass="labelstd" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="TextBox3" runat="server" Text="Address2:" CssClass="labelhdr" /></td>
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("address2") %>' CssClass="labelstd" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tbct" runat="server" Text="City:" CssClass="labelhdr"></asp:TextBox></td>
    
    
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("city") %>' CssClass="labelstd" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tbsy" runat="server" Text="State:" CssClass="labelhdr" /></td>
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="stateidTextBox" runat="server" Text='<%# getState(Eval("stateid").ToString()) %>' CssClass="labelstd" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tbz" runat="server" Text="Postal/ZIP Code:" CssClass="labelhdr" />
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="postalcodeLabel" runat="server" Text='<%# Bind("postalcode") %>' CssClass="labelstd" />
                                                    </tr>
                                                    <tr>
                                                        <td class="tdrt">
                                                            <asp:TextBox ID="tbcn" runat="server" Text="Country:" CssClass="labelhdr" />
                                                        <td class="tdlt">
                                                            <asp:TextBox ID="isoLabel" runat="server" Text='<%# getCountry(Eval("iso").ToString()) %>' CssClass="labelstd" />
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <asp:Button ID="EditButton" runat="server"
                                                                CausesValidation="False" CommandName="Edit Address"
                                                                Text="Edit Address" OnClick="EditButton_Click" />
                                                        </td>
    
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:FormView>
                                       
                                    </ContentTemplate>
                                </asp:UpdatePanel>                
                                
                            </div>
                            <div>
                            <div style="float: left; width: 320px; margin-right: 20px; margin-left: 45px; margin-top: 20px; text-align:left;
                                   background-color: aliceblue; border: solid 1px; border-color: firebrick; border-radius: 5px; padding: 2px">
    
                                    <asp:Panel ID="Panel2" runat="server" Style="background-color: aliceblue;">
                                        <div style="background-color: lightskyblue; height: 40px; padding: 2px; text-align:left;">
                                            <asp:Label ID="Label7" runat="server" Font-Bold="True" Font-Size="Large" Text="Address Requirements"></asp:Label>
                                            <br />
                                            </asp:Panel>
                            <ul>
                                <li>Street Address is no longer a required field. </li>
                               <li>Postal Code, is not required.
                               </li>
                                 <li>Still required are your City, State and Country </li>
                            </ul>
                                </div>
                                   
                        </div>
                    </asp:Panel>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
    END tab 2
                 
               Tab page 3 - only the header panel displays.
                 <ajaxToolkit:TabPanel ID="TabPanel3" runat="server" BackColor="AliceBlue" Width="800">
                <HeaderTemplate>
                    <asp:Label ID="Label10" runat="server"  Text="My Address"></asp:Label>
                </HeaderTemplate>
               
                <ContentTemplate>
                    <asp:Panel ID="Panel3" runat="server" Width="800px" Height="300px" CssClass="profilepanel">
                             <div>
    
                             <div style="float: left; width: 320px; margin-right: 20px; margin-left: 25px; margin-top: 20px; background-color: aliceblue; border: solid 1px; border-color: firebrick; border-radius: 5px; padding: 2px">
                                 <asp:Label ID="Label11" runat="server" Text="Label"></asp:Label>
                                </div>
                                 </asp:Panel>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
                
    </ajaxToolkit:TabContainer>

    this example only has a label on the third page, but it is blank. Anyone know whats wrong?
    .

    Saturday, August 20, 2016 12:02 AM

Answers

  • User-1142886626 posted

    Hi dieseldave,

    Make sure each tag has a closing tag, it will affect the display of last panel. From the code you provided, I found a place there is no closing tag. You need to check the other sections.

    <HeaderTemplate>
                    <asp:Label ID="Label8" runat="server"  Text="My Address"></asp:Label>
                </HeaderTemplate>
               
                <ContentTemplate>
                    <asp:Panel ID="Panel1" runat="server" Width="800px" Height="300px" CssClass="profilepanel">
                             <div> (this seems have no closing tag)
    

    Best Regards,

    Ailleen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 22, 2016 12:41 PM