Does Visual Studio have a capability, or is there a VS plug-in, t开发者_JAVA技巧hat 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?
Yes, you can use the shortcut CTRL + K + D to reformat ASP.NET and HTML markup!
I don't think Visual Studio has this functionality built it but the Resharper plugin has this is a contextual option. It will let you click on any tag and choose to have it re-order them alphabetically.
精彩评论