ASP.NET’s “I format your HTML however I feel like” bug

I have been adding controls to a multipage today and for some reason you can’t just drag them onto it in design mode (as far as I can tell), you have to edit the html so that the items are between the move the pageview tags and then you have to set there coordinates manually. Not hard, just tedious, but having to do it reminded me again of it’s stupid HTML formatting issues.

One of the first things I noticed I disliked about ASP.NET is this problem.

My first complaint it about the way it formats the HTML code as you insert components in design view. It doesn’t seem to have any logic to it at all! Things appear in strange orders, the line breaks are in bizarre places and it blocks odd pieces of code together.

My first thought after seeing this was, ‘No problem, I’ll just move it around myself,’ which I did, then went back into design view.

That brings us to the second problem; on switching back to HTML view you find that it has rearranged everything again!

The third problem is that there seems to be no way to fix either of the first two problems.

Oh! It also removes extra things you might have added, like a field that lets Firefox read an items height or width, thanks for that Microsoft!

I’m not even going to think about what normal paste does and how you have to use ‘paste as html’ all the time.

I did a search on the web after discovering this little quirk and discovered that while I was not the only one who found it annoying, no one really had a good solution for it.

Microsoft themselves recommend these two half-arsed half-fixes, which are:

1. Click undo after you switch to HTML view, this may or may not fix the reformatting and may not also undo whatever change you just made.

2. Click save before switching back to design view, then when you switch back to HTML view it might not have reformatted everything. Most of the time.

They also stated that there is no way to turn this ‘feature’ off, despite the development team considering it to be a bug. Oh well.

If you turn off Word Wrap in Tools / Options / Text Editor / HTML/XML / General – Settings it helps a little because then at least lines that shouldn’t be broken up might not be. Instead you will often get a long line of code (not always, it seems to be really erratic) but if you put them on their own lines they will sometimes stay there.

Honestly it’s a major pain and some days it just pisses me off… like today!

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s