views:

29

answers:

2

I am working on some old web forms application.

When I changed from design to view source of the aspx page, the aspx markup becomes disarranged.

For example, a label is written as follows:

<asp:label id="Label20" 
           style="Z-INDEX: 119; LEFT: 16px; POSITION: absolute; TOP: 424px" 
           runat="server"
           Height="24px" Width="72px">Instructions:</asp:label>

It suddenly becomes like this (when I toggle from design to source)

<asp:label id="Label20" style="Z-INDEX: 119; LEFT: 16px; POSITION: absolute; TOP: 424px" runat="server"
                Height="24px" Width="72px">Instructions:</asp:label>

Notice that the alignment and margins, tab stops are changed. Any idea how to prevent VS from doing this?

Thanks.

+1  A: 

You can adjust your formatting options under Tools, Options. Expand Text Editor, HTML, Format. There is a button for "Tag Specific Options".

Germ
+1  A: 

Go to options then select the Text Editor tree node on the left. Find the Format node under that and set Server Tag and Server attribute to as entered. Then it should stop.

Jason Webb