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)?
views:
1959answers:
5And it works in 2008 as well. You are my hero for at least the next 5 minutes.
TheTXI
2009-03-10 14:37:10
yea baby! I wrote this on my whiteboard!
Saif Khan
2009-07-16 15:29:23
+2
A:
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...
James Curran
2009-03-10 14:41:41
A:
You want to go to Tools > Options and then navigate to Text Editor > All Languages > Tabs.
The settings you want are: Under Indenting click the "Smart" Radio box for smart indenting. Under Tab you want tab size 4 and indent size 4. And check the radio button labeled Insert Spaces.
You can also change these settings for each language individually. Also some of them don't have Smart indenting, like html.