Error With The MS Visual Studio Development Environment

J

Jacob Crossley

Preface: Not to sound mean or arrogant, but please don't answer this
question unless you have a specific and tested answer. I'm saying this only
because I posted the same quesion earlier and got spammed by this so-called
Microsoft MVP that gave me a very vague answer, followed by a series of
incorrect answers that I had already mentioned were tried, tested and
failed. Sorry I had to start my post like that : - ) but here goes my actual
question:



I'm into writing perfectly indented html, but the .net dev environment is
being overzealous and messing up my html formatting when I switch from
design to code view.

for example, I originally write:

<table>
<tr>
<td>
<asp:label id="lblSuccess" runat="server">
</asp:/label>
</td>
</tr>
</table>

then the dev environment switches it to something like:

<table>
<tr>
<td><asp:label id="lblSuccess" runat="server"></asp:/label>
</td></tr></table>


I'm running the latest version of .net --version 7.1.3088

*****
I've run through the tools/options and placed the envirionment to do the
least amount of microsoftesque-preemptive formatting.
***

Please HELP!!! If there is no solution I think I'm gonna code .net stuff in
notepad until I can get a linux, bsd or UNIX job...lol jk. I've been an MS
developer for years!
 
S

Steve C. Orr [MVP, MCSD]

There is no solution at this time.
VS.NET 2002 and 2003 will reformat your HTML when they see fit.
Thankfully, VS.NET 2005 will finally fix this thoroughly hated "feature."
 
J

Jacob Crossley

I figured that this was a wonderful Microsoft 'Feature'. Thanks for the
honest answer Steve. Well if anyone from the .net dev team reads this post,
PLEASE roll away this feature before the 2005 release, a patch would be so
much appreciated!
 
S

Steve C. Orr [MVP, MCSD]

To be honest I don't think a patch is possible. From what I understand the
cause is rooted deep in Frontpage libraries that are being used way
underneath it all. The only way to fix it is to create a whole new HTML
formatting system, which I *think* is what they've done in Whidbey (VS.NET
2005).

A workaround is to always use HTML view and never use the designer, but
personally I prefer slightly funky HTML formatting over that idea.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
 
E

Eliyahu Goldin

Jacob,

I also like perfectly indented HTML. This is one of the reasons why I am
using HTML view 99% of time. The Visual Studio messes up the formatting only
if you make changes in Design view and your HTML view has to change
accordingly. Even if you have to switch to design view and to change
something, you still have a chance to restore the formatting when you switch
back to HTML. Locate the changed HTML, select and copy the change to the
clipboard. Then press Ctrl-Z. It should fix the formatting and will undo the
change. Then paste the change from the clipboard back.

Eliyahu
 
J

Jacob Crossley

I actually only switch to the designer for a reason other than design. When
one switches to the design view, object creation statements are written in
the code behind. Anyway, I'm hoping whidbey is more like an adult
development environment and less like MS word. : - )
 
S

Scott C. Reynolds

Indeed. I try to write all of my runat=server elements onto the page,
switch to design to render the control creating statements, and then do
all of my HTML and whatnot back in html view, never switching to design
mode again. If I add another server element or two, I just write the
instantiating code myself. It isn't worth the hassle.

Someone on the VS.net team blogged about this, and how they just stole
the html rendering from IE rather than spend time writing their own. So
basically IE is rendering your html, and it has no clue about
whitespace, line breaks, or proper attributes (since when does
align=center mean align=middle). So when it "de-renders" back to HTML
view, it tries to make a close approximation of what you had, but it
isn't exact. I tried to find the blog entry but alas, I could not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top