Reputation: 11502
In Visual Studio 2010, is it possible to change the formatting of HTML documents such that it doesn't indent for <asp:*>
sections? I'm trying to achieve this:
<asp:content contentplaceholderid="content" runat="server">
<!DOCTYPE html>
<html>
<head>
...
</body>
</html>
</asp:content>
Rather than this:
<asp:content contentplaceholderid="content" runat="server">
<!DOCTYPE html>
<html>
<head>..</head>
<body>..</body>
</html>
</asp:content>
So that what eventually gets served to the browser has nothing before the <!DOCTYPE html>
:
<!DOCTYPE html>
<html>
<head>..</head>
<body>..</body>
</html>
Which is just neater, and I think probably less error-prone.
I know I could just manually format the document and then never use the auto-format option (ctrl+k ctrl+d
), but that's just annoying.
Upvotes: 1
Views: 396
Reputation: 6903
Tools -> Options -> Text Editor -> HTML -> Formatting -> then hit the button marked 'Tag Specific options' on the right pane -> then chose ASP.Net Controls on the left pane. Then choose the tag you wish to modify (asp:placeholder) and uncheck the checkbox marked 'Indent contents'.
In the "Tag specific options" windows, under "Default Settings" select "Server tag supports contents" and uncheck "Indent contents".
Upvotes: 1