views:

39

answers:

2

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.

A: 

Hi,

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
I did this and changed "Indenting" to "None" and it's still happening
JoelFan
A: 

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

Saif Khan
That does format my code, but it's still indenting more than I want. I want the code in the <script> tag to be aligned all the way to the left.
JoelFan
This might help http://stackoverflow.com/questions/737222/turn-off-auto-formatting-in-visual-studio
Saif Khan