Subject: Re: Use of ASP.NET control does not preserve whitespace.
Date: Thu, 13 Nov 2003 10:18:40 -0800
Lines: 346
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: dsl-107.goldrush.com 206.171.170.107
Path: cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!TK2MSFTNGP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:190722
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
While I appreciate the time it took to respond to this thread you
workarounds do not work (I have tried) as the problem is beyond the editor.
Please consider the following code , paying particular attention to the
spaces:
This text is before <asp:hyperlink id="hl1" runat="server"
navivateurl="
http://www.microsoft.com">link to microsoft</asp:hyperlink>
This text is after
When in HTML view, if I enter the code exactly as shown (as one single line
of code). Then I save (never switching to design mode) then compile and run
my code, the following is an example of the output of the page:
This text is before link to microsoftThis text is after
Notice the space is missing from between the words microsoft and This
If there is any sort of whitespace after the hyperlink, space, newline, tab,
etc. the output should show a whitespace between these words, there is not.
This is, in all likelihood, a compiler issue. As I said in my original post,
if I replace the <asp:hyperlink> with an <a> tag the whitspace is retained.
True, there is a problem with the editor, I understand the complexity of
fixing the formatting issue, however, IMO, giving a developer a way to
switch off the formatting altogether would be a logical first step with,
relatively, little effort. It certainly would be a step in the right
direction. After all, this formatting issue affects EVERYONE who uses VS.NET
to edit ASP.NET pages.
Regards
Brian W
"Mike Moore [MSFT]" said:
Hi,
This thread is discussing a bug in the Visual Studio .NET development
environment for ASP.NET. If you type directly into the HTML view of the
ASPX page, sometimes VS will reformat what you have typed.
---
First, I want to apologize for the inconvenience this bug has caused you.
We make the best products that we can. Being large & complex, it's hard to
make these products perfect in every way.
There are two "partial" workarounds. These help, but do not fix the problem.
1) Undo
Each time you return to HTML view, immediately run Undo. The formatting
changes mostly take place when you switch from design view to HTML view and
these changes are mostly in a single undo entry. Calling undo then reverses
many of the changes.
2) Save
Saving the ASPX page just prior to switching to design view reduces the
amount of reformatting the next time you switch back to HTML view.
---
Many people have asked why this bug has not been fixed.
I found that the development team did seriously consider fixing this bug
for the 1.1 release. The first thought was to add an option to turn off the
reformatting feature. Unfortunately, it turned out to be deeply integrated
in the code that makes the editor useful. So, it could not be turned off.
Nor could it easily be fixed. Any changes made to this area of the code
would definitely impact many aspects of the editor.
If they could go back in time and rethink that decision, things might be
otherwise. However, at the time, the development team looked at all the
information they had available and decided that trying to fix this for the
1.1 release would cause more harm than good.
This continues to be considered an important item. So, I expect it will be
fixed, but I don't know when.
Thank you, Mike
Microsoft, ASP.NET Support Professional
Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer's security.
This posting is provided "AS IS", with no warranties, and confers no rights.<#
[email protected]>
<
[email protected]>
<
[email protected]>
Subject: Re: Use of ASP.NET control does not preserve whitespace.
Date: Wed, 12 Nov 2003 13:40:10 -0800
Lines: 198
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: dsl-107.goldrush.com 206.171.170.107
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:190501
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Yes, I too have since come to the same conclusion, with one addition.
If, after the </asp:hyperlink> you place a space AND a carriage return you
get the desired result.
The problem here is that if you switch to design mode this formatting is
lost.
What it all boils down to is this: The editor sucks! It is just plain
unreasonable for an editor to format/change your code, whether you
what
it enough with
the sure will
it as
to
placed