Configuring the formatting of <% %> blocks in Visual Studio editor

后端 未结 4 467
-上瘾入骨i
-上瘾入骨i 2021-02-05 20:28

In Visual Studio 2010, under Tools -> Options -> Text Editor -> HTML -> Formatting -> Tag Specific Options, there are options for configuring how the editor auto formats differe

4条回答
  •  伪装坚强ぢ
    2021-02-05 21:03

    Well, there's Edit -> Advanced -> Format Document, which I guess messes your code up as well. I searched loads of documentation trying to find something more, but as far as I can say, there isn't anything.

    Edit: The Problem isn't in the HTML Formatting options but with the <% %> "tag". For example:

    works quite well. As I said, I don't think this can be done.

    For the moment I recommend using:

    <%="Hello World" %>

    or

    <% if(true) Response.Write("Hello World"); %>

提交回复
热议问题