working in Visual Studio .NET and ASP.NET, the IDE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

does anyone know of a way to highlight a page of code (HTML) and have it
"auto-formatted/structured" for better readablity? Instead of going back and
tabbing all the indents myself, etc. (being lazy) When you have a lot of page
code it would be nice to have this capaiblity, as sometimes my formatting
gets sloppy at times.

i.e.
<!-- start of table -->
<table>
<tr>
<td>
<asp:dropdownlist ..... >
</td>
</tr>
</table>

to this:
<!-- start of table -->
<table>
<tr>
<td>
<asp:dropdownlist ..... >
</td>
</tr>
</table>

thanx.
 
Hi Chris,

How about Edit > Advanced > Format Document?

In some keyboard schemes, Cntrl + K, Cntrl + D does it too.

There's also Tabify under Advanced.

Ken
 
I don't see a "Format Document" option in the Advanced area? I'm using VS 2003.
I've tried "Tabify" and it didn't do anything after highlighting the code
and selecting it. Also this option isn't smart enough to structure the code,
that I can see?
I'm really surprised that there isn't an auto-format with the VS IDE.

Any other suggestions?
 
Hey Chris,

Try this:
1. Go Tools > Customize > Commands.
2. Select the Edit category in the left hand pane.
3. Scroll through the right-hand pane to find Document Format.
4. Drag the Document Format Item and drop it on a toolbar.

Does this work?

Ken
 
Also go to Tools > Options > Keyboard and look for Edit. FormatDocument and
Edit.FormatSelection. Assign them to keys you want to use.

Ken
 
no, I tried and though it is on the toolbar it is "greyed out" (enable set to
false)???

I'm on the design("HTML") view of my code, there is no "Design" tab. That
has something to do with my use of src in the Page Inherits tag on the pages.
Apparently VS doesn't support "src=" but most coding examples in leading
books (i.e. unleashed) uses it.
 
Back
Top