0

When I am editing VB code inside a .aspx file in Visual Studio 2010, my code is automatically indented in a bizarre way. I have searched through the options and can't find anything that fixes this. [I thought unchecking Pretty listing (reformatting) of code in Text Editor -> Basic -> VB Specific would for sure do the trick but it didn't]

Example -- here is the beginning of a .aspx page:

<%@ Page EnableSessionState="True" Language="VB" Strict="true" %>
<script language="VB" runat="Server">
Dim foo As String

If I go to the end of the "Dim foo" line and hit it will indent. If I fix the indentation, the next line will do the same thing.

Adam Lear
  • 38,111
  • 12
  • 81
  • 101
JoelFan
  • 37,465
  • 35
  • 132
  • 205

2 Answers2

1

In my IDE I often use "CTRL K + CTRL D" and VS formats my code really neat. Maybe that might help.

Saif Khan
  • 18,402
  • 29
  • 102
  • 147
  • That does format my code, but it's still indenting more than I want. I want the code in the – JoelFan Oct 14 '10 at 15:51
  • This might help http://stackoverflow.com/questions/737222/turn-off-auto-formatting-in-visual-studio – Saif Khan Oct 14 '10 at 15:54
0

In Visual Studio, under the Tools --> Options menu item you will find Text Editor --> Basic --> Tabs. The setting under this section will allow you to control the indenting however you would like to.

Enjoy!

Doug
  • 5,268
  • 24
  • 31