开发者

Changing ASP.NET tag formatting

开发者 https://www.devze.com 2022-12-26 07:32 出处:网络
When I drag a Label control to my document, I get the following c开发者_StackOverflow中文版ode :

When I drag a Label control to my document, I get the following c开发者_StackOverflow中文版ode :

<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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消