Pretty-Printing in XP.NET??

  • Thread starter Thread starter Richard Lionheart
  • Start date Start date
R

Richard Lionheart

Hi All,

I've written some code in a .aspx file that I like the looks of. However,
when I run it in VS.NET, VS sometimes throws away a lot of the indentation,
which makes it difficult for me to work on. I think it occurs when I create
a mal-formed <form>. Is there a way to defeat this behavior or otherwise
pretty-print the code to restore my formatting?

Right now, my work around is to save the code in a .txt file, test my
code, replace any condensed code that VS gives me with the saved code.
 
Richard,

You might try changing some of the Text Editor options. In VS 2003, go
to Tools > Options > Text Editor > HTML\XML. See Format > Apply
Automatic Formatting, and Tabs > Indenting (try setting to none).

Alternatively, to pretty-print your document, select all of the text in
it Edit > Select All and then Edit > Advanced > Format Selection. The
common shortcut to this is CTRL+A, CTRL+K, CTRL+F.

If the formatting isn't work, it may be as you said, and the IDE is
having problems parsing your document structure.

Good luck!

-- Tim Scott
http://geekswithblogs.net/tscott
 
Hi Tim,

Thanks for the ideas. Strangely, the symptom has gone away, somehow,
probably because I cleaned up every single error. Right now, I'm saving
old versions before I save a revised version. It's working for now, so I'm
just saving your advice for the time being.

Again, thanks,
Richard
 
Back
Top