locked
ajax tab container error occur the server tag not well formed? RRS feed

  • Question

  • User-1026236167 posted

    ajax tab container does not run error occur the server tag is not welll formed 

    here is my code 

    aspx

    <div>


    <br />

    <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" Height="229px" Width="353px">
    <asp:TabPanel runat="server" HeaderText="Login Form" ID="TabPanel1">
    <ContentTemplate>
    <asp:Label ID="lbllogin" runat="server" Text="Login Here" "True" "True" "True" ForeColor="#660033"></asp:Label>
    <table style="width: 100%;" border:"1">
    <tr>
    <td><asp:Label ID="lbluname" runat="server" Text="UserName" "True" ForeColor="#000099"></asp:Label></td>
    <td><asp:TextBox ID="tbuname" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
    <td><asp:Label ID="lblpass" runat="server" Text="Password" "True" ForeColor="#000099"></asp:Label></td>
    <td><asp:TextBox ID="tbpass" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
    <td></td>
    <td><asp:Button ID="Button1" runat="server" Text="Submit" BackColor="#0099FF" "True" ForeColor="#000099" Height="27px" /></td>
    </tr>
    </table>
    </ContentTemplate>
    </asp:TabPanel>
    <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="Registration Form">
    <ContentTemplate>
    <asp:Label ID="lblRegistration" runat="server" Text="Registration Here" "True" "True" "True" ForeColor="#660033"></asp:Label>
    <table style="width: 100%;" border:"1">
    <tr>
    <td><asp:Label ID="lblUserName" runat="server" Text="UserName" "True" ForeColor="#000099"></asp:Label></td>
    <td><asp:TextBox ID="tbUserName" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
    <td><asp:Label ID="lblPassword" runat="server" Text="Password" "True" ForeColor="#000099"></asp:Label></td>
    <td><asp:TextBox ID="tbPassword" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
    <td><asp:Label ID="lblFname" runat="server" Text="FirstName" "True" ForeColor="#000099"></asp:Label></td>
    <td><asp:TextBox ID="tbFname" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
    <td><asp:Label ID="lblLastName" runat="server" Text="LastName" "True" ForeColor="#000099"></asp:Label></td>
    <td><asp:TextBox ID="tbLastName" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
    <td> </td>
    <td><asp:Button ID="btnsave" runat="server" Text="Save" BackColor="#0099FF" "True" ForeColor="#000099" Height="27px"/></td>
    </tr>
    </table>
    </ContentTemplate>
    </asp:TabPanel>
    </ajaxToolkit:TabContainer>
    </div>

    Wednesday, July 22, 2020 7:32 AM

Answers

  • User-1330468790 posted

    Hi prabhjot1313,

     

    There are several errors in your codes:

    1. Unnecessary "True" in asp controls: For example, <asp:Label ID="lbllogin" runat="server" Text="Login Here" "True" "True" "True" ForeColor="#660033"></asp:Label>. 
      • Solution: Remove "True".
    2. Table contains border property however not well formed, e.g. <table style="width: 100%;" border:"1">.
      • Solution: change ':' to '='
    3. TabPanel has been added with wrong prefix "asp". e.g. <asp:TabPanel runat="server" HeaderText="Login Form" ID="TabPanel1">
      • Solution: Change "asp" to "ajaxToolkit"

    Below is the modified code block. Please check if it works in your side.

     <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" Height="229px" Width="353px">
                    <ajaxToolkit:TabPanel runat="server" HeaderText="Login Form" ID="TabPanel1">
                        <ContentTemplate>
                            <asp:Label ID="lbllogin" runat="server" Text="Login Here" ForeColor="#660033"></asp:Label>
                            <table style="width: 100%;" border="1">
                                <tr>
                                    <td>
                                        <asp:Label ID="lbluname" runat="server" Text="UserName" ForeColor="#000099"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="tbuname" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblpass" runat="server" Text="Password" ForeColor="#000099"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="tbpass" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>
                                        <asp:Button ID="Button1" runat="server" Text="Submit" BackColor="#0099FF" ForeColor="#000099" Height="27px" /></td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </ajaxToolkit:TabPanel>
                    <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Registration Form">
                        <ContentTemplate>
                            <asp:Label ID="lblRegistration" runat="server" Text="Registration Here" ForeColor="#660033"></asp:Label>
                            <table style="width: 100%;" border="1">
                                <tr>
                                    <td>
                                        <asp:Label ID="lblUserName" runat="server" Text="UserName" ForeColor="#000099"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="tbUserName" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblPassword" runat="server" Text="Password" ForeColor="#000099"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="tbPassword" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblFname" runat="server" Text="FirstName" ForeColor="#000099"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="tbFname" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblLastName" runat="server" Text="LastName" ForeColor="#000099"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="tbLastName" runat="server"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>
                                        <asp:Button ID="btnsave" runat="server" Text="Save" BackColor="#0099FF" ForeColor="#000099" Height="27px" /></td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </ajaxToolkit:TabPanel>
                </ajaxToolkit:TabContainer>

     

    Hope this can help you.

    Best regards,

    Sean

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 22, 2020 8:50 AM