Visual Studio 2005 : Is there an easy way to indent correctly in an ASPX file?

13,521

Solution 1

You can fix indenting using the shortcut Ctrl-K+D

Solution 2

Those keystrokes translate to:

  • Ctrl-K, Ctrl-D : Edit/Advanced/Format Document
  • Ctrl-A, Ctrl-K, Ctrl-F : Edit/Select All, Edit/Advanced/Format Selection

For some reason, the latter seems to work better for me.

Note, these also work for other file types: C#, VB, XML etc...

Solution 3

Ctrl-A (select all), Ctrl-K-F has worked for me.

Share:
13,521
Cedric Aube
Author by

Cedric Aube

Updated on June 04, 2022

Comments

  • Cedric Aube
    Cedric Aube almost 2 years

    In Visual Studio 2005, is there a way to indent correctly the tags in the aspx file (not in .cs files but really in ASPX files which contain HTML/ASP code)?

  • TheTXI
    TheTXI about 15 years
    And it works in 2008 as well. You are my hero for at least the next 5 minutes.
  • Saif Khan
    Saif Khan almost 15 years
    yea baby! I wrote this on my whiteboard!