asp.net – Visual Studio Auto Formatting not working on the aspx page – Education Career Blog

I am running Visual Studio 2008. I cannot get the auto format to work on the source code of my aspx page. I have tried it from the edit menu and the ctrl K, D. Nothing works. If I manually fix everything, the next time I open the file the formatting is gone. Here is a sample of what it looks like:

<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="2" CssClass="ajax__myTab" Width="100%" ScrollBars="Horizontal">
    <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Work - Main" Enabled="true">
        <headertemplate>
            Main
        </headertemplate>
        <contenttemplate>
            <table cellpadding="3" cellspacing="1">
                <tr>
                    <td style="text-align: right">
                        Escalated Inquiry ID:
                    </td>
                    <td>
                        <asp:Label ID="lblPkey" runat="server"></asp:Label>
                    </td>

,

take a look at this post. Also, make sure you don’t have any missing closing tags.

,

I have seen this when there is a problem with the HTML. If there is an error in syntax (missing a closing tag, for instance), then the parser doesn’t know where the tabs should go.

EDIT

Based on your sample (assuming you pasted everything)

<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="2" CssClass="ajax__myTab" Width="100%" ScrollBars="Horizontal">
    <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Work - Main" Enabled="true">
        <headertemplate>
            Main
        </headertemplate>
        <contenttemplate>
            <table cellpadding="3" cellspacing="1">
                <tr>
                    <td style="text-align: right">
                        Escalated Inquiry ID:
                    </td>
                    <td>
                        <asp:Label ID="lblPkey" runat="server"></asp:Label>
                    </td>

, here is what is missing:

                </tr>
            </table>
        </contenttemplate>
    </cc1:TabPanel>
</cc1:TabContainer>

Leave a Comment