Steven
Steven

Reputation: 75

Changing ASP.NET tag formatting

When I drag a Label control to my document, I get the following code :

<asp:Label ID="Label1" runat="server" text="Label"></asp:Label>

I prefer my code to look like the following instead :

<asp:Label ID="Label1" runat="server" Text="Label" />

How can I get .NET to do this by default? I looked in Tools -> Options -> Text Editor, where you'd expect to find it, but I couldn't find anything relevant there.

Upvotes: 1

Views: 180

Answers (1)

PhilPursglove
PhilPursglove

Reputation: 12589

Go back to Tools|Options|Text Editor, and expand the HTML node in the tree. Go to the Format node, and the click the Tag-Specific Options button. In the dialog that opens up, expand the ASP.NET controls tree and find asp:Label. You can set how you want the closing tag in the selector at the top on the right. alt text http://philippursglove.com/stackoverflow/tagspecificclosingoption.png

Upvotes: 2

Related Questions