Reorder Attributes (ASP.NET)

Allows you to change the order of tag attributes.

If the code contains similar tags and the following conditions are fulfilled, Refactor! offers to apply the attributes order to them.

  • The tags should have the same parent tag.
  • The tags should contain the same attributes set.

Availability

Available from the context menu or via shortcuts:

  • when the cursor is in a tag that contains more than one attribute.

Examples

<div id="div1">
    <img id="img1" src="D:\Image1.jpg" style="width: 100px;" />
    <img id="img2" src="D:\Image2.jpg" style="width: 100px;" /> 
    <img id="img3" src="D:\Image3.jpg" style="width: 100px;" />
</div>
<div id="div2">
    <img id="img4" src="D:\Image4.jpg" style="width: 100px;" />
    <img id="img5" src="D:\Image5.jpg" style="width: 100px;" />
</div>

Result:

<div id="div1">
    <img src="D:\Image1.jpg" id="img1" style="width: 100px;" />
    <img src="D:\Image2.jpg" id="img2" style="width: 100px;" />
    <img src="D:\Image3.jpg" id="img3" style="width: 100px;" />
</div>
<div id="div2">
    <img id="img4" src="D:\Image4.jpg" style="width: 100px;" />
    <img id="img5" src="D:\Image5.jpg" style="width: 100px;" />
</div>

Animation

rsReorderAttributes