Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio ASP.NET/HTML reformat capability - does it exist?

Does Visual Studio have a capability, or is there a VS plug-in, that will reformat ASP.NET and HTML markup (i.e. perform pretty printing). Specifically, I want it to put all properties or attributes in alphabetical order for each tag, possibly with some exceptions that the user can specify, say in a config file. Also, each property or attribute could optionally be put on an individual line, again per the user's specification.

For example consider the following:

<asp:TextBox ID="txtPlanStart" runat="server" ToolTip="start date" Columns="8">

The reformatted version would be:

<asp:TextBox ID="txtPlanStart" runat="server" 
     Columns="8"
     ToolTip="start date" />

Note that the reformatted version not strictly in alphabetical order or on separate lines, because ID and runat come first. Again exceptions to the reformatting could be specified by the user.

If this capability is not available integrated in VS, is there some other utility available?

like image 222
harrije Avatar asked Dec 18 '25 08:12

harrije


1 Answers

Yes, you can use the shortcut CTRL + K + D to reformat ASP.NET and HTML markup!

like image 198
alepaltri Avatar answered Dec 20 '25 22:12

alepaltri