Connecting Tech Pros Worldwide Forums | Help | Site Map

Use of ASP.NET control does not preserve whitespace.

Brian W
Guest
 
Posts: n/a
#1: Nov 17 '05
Yet another editor problem

To reproduce do the following

1) Open a Webform and switch to HTML edit mode

2) Enter the Following (include spaces)
This is some text before <asp:hyperlink id="hl1" runat="server "
navigateurl="http://www.microsoft.com">This is my link</asp:hyperlink> And
this is my text after the Hyperlink

3) Switch back to design mode.
Notice, the space has been remove between the hyperlink and the word
"And"

4) Now, in design mode type a space character between the hyperlink and the
word "And"

5) Switch back to HTML edit mode and notice the IDE placed a &nbsp; where
you typed the space character.
This is not always an acceptable workaround.


To prove this only happens with the ASP.NET control, perform the following
space

1) Open the Webform in HTML edit mode again

2) Enter the following (include spaces)
This is some text before <a href="http://www.microsoft.com">This is
my HTML hyperlink</a> And this text appears after the HTML hyperlink.

3) Switch to design mode
Notice the space between the hyperlink and the word "And" is
retained, and no &nbsp; characters are inserted.


Any recommendations?

TIA

Regards
Brian W




Cliff Harris
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


I have noticed the same problem... it is, at times, inconvenient.
However, I do not understand why inserting an &nbsp; character
isn't an acceptable workaround? Just a few more keystrokes :)


"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...[color=blue]
> Yet another editor problem
>
> To reproduce do the following
>
> 1) Open a Webform and switch to HTML edit mode
>
> 2) Enter the Following (include spaces)
> This is some text before <asp:hyperlink id="hl1" runat="server "
> navigateurl="http://www.microsoft.com">This is my link</asp:hyperlink> And
> this is my text after the Hyperlink
>
> 3) Switch back to design mode.
> Notice, the space has been remove between the hyperlink and the[/color]
word[color=blue]
> "And"
>
> 4) Now, in design mode type a space character between the hyperlink and[/color]
the[color=blue]
> word "And"
>
> 5) Switch back to HTML edit mode and notice the IDE placed a &nbsp; where
> you typed the space character.
> This is not always an acceptable workaround.
>
>
> To prove this only happens with the ASP.NET control, perform the following
> space
>
> 1) Open the Webform in HTML edit mode again
>
> 2) Enter the following (include spaces)
> This is some text before <a href="http://www.microsoft.com">This[/color]
is[color=blue]
> my HTML hyperlink</a> And this text appears after the HTML hyperlink.
>
> 3) Switch to design mode
> Notice the space between the hyperlink and the word "And" is
> retained, and no &nbsp; characters are inserted.
>
>
> Any recommendations?
>
> TIA
>
> Regards
> Brian W
>
>
>[/color]


Brian W
Guest
 
Posts: n/a
#3: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


Thanks for your comments, Cliff.

No, I said "...not ALWAYS an expectable workaround"

It has nothing to do with the number of keystrokes to type "&nbsp;" The
difference between having a non-breaking space and not having one could in
some cases make a difference between your layout looking good and looking
like crap ;-)

Regards
Brian W


"Cliff Harris" <hersh@myrealbox.com> wrote in message
news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...[color=blue]
> I have noticed the same problem... it is, at times, inconvenient.
> However, I do not understand why inserting an &nbsp; character
> isn't an acceptable workaround? Just a few more keystrokes :)
>
>
> "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...[color=green]
> > Yet another editor problem
> >
> > To reproduce do the following
> >
> > 1) Open a Webform and switch to HTML edit mode
> >
> > 2) Enter the Following (include spaces)
> > This is some text before <asp:hyperlink id="hl1" runat="server "
> > navigateurl="http://www.microsoft.com">This is my link</asp:hyperlink>[/color][/color]
And[color=blue][color=green]
> > this is my text after the Hyperlink
> >
> > 3) Switch back to design mode.
> > Notice, the space has been remove between the hyperlink and the[/color]
> word[color=green]
> > "And"
> >
> > 4) Now, in design mode type a space character between the hyperlink and[/color]
> the[color=green]
> > word "And"
> >
> > 5) Switch back to HTML edit mode and notice the IDE placed a &nbsp;[/color][/color]
where[color=blue][color=green]
> > you typed the space character.
> > This is not always an acceptable workaround.
> >
> >
> > To prove this only happens with the ASP.NET control, perform the[/color][/color]
following[color=blue][color=green]
> > space
> >
> > 1) Open the Webform in HTML edit mode again
> >
> > 2) Enter the following (include spaces)
> > This is some text before <a href="http://www.microsoft.com">This[/color]
> is[color=green]
> > my HTML hyperlink</a> And this text appears after the HTML hyperlink.
> >
> > 3) Switch to design mode
> > Notice the space between the hyperlink and the word "And" is
> > retained, and no &nbsp; characters are inserted.
> >
> >
> > Any recommendations?
> >
> > TIA
> >
> > Regards
> > Brian W
> >
> >
> >[/color]
>
>[/color]


Brian W
Guest
 
Posts: n/a
#4: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


While I'm on the editor subject...

Why does the editor change &copy; to © ?

I know they mean the same thing, but would the actual © character be
recognized accross browsers?

Regards
Brian W



"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...[color=blue]
> Yet another editor problem
>
> To reproduce do the following
>
> 1) Open a Webform and switch to HTML edit mode
>
> 2) Enter the Following (include spaces)
> This is some text before <asp:hyperlink id="hl1" runat="server "
> navigateurl="http://www.microsoft.com">This is my link</asp:hyperlink> And
> this is my text after the Hyperlink
>
> 3) Switch back to design mode.
> Notice, the space has been remove between the hyperlink and the[/color]
word[color=blue]
> "And"
>
> 4) Now, in design mode type a space character between the hyperlink and[/color]
the[color=blue]
> word "And"
>
> 5) Switch back to HTML edit mode and notice the IDE placed a &nbsp; where
> you typed the space character.
> This is not always an acceptable workaround.
>
>
> To prove this only happens with the ASP.NET control, perform the following
> space
>
> 1) Open the Webform in HTML edit mode again
>
> 2) Enter the following (include spaces)
> This is some text before <a href="http://www.microsoft.com">This[/color]
is[color=blue]
> my HTML hyperlink</a> And this text appears after the HTML hyperlink.
>
> 3) Switch to design mode
> Notice the space between the hyperlink and the word "And" is
> retained, and no &nbsp; characters are inserted.
>
>
> Any recommendations?
>
> TIA
>
> Regards
> Brian W
>
>
>[/color]


Cliff Harris
Guest
 
Posts: n/a
#5: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


That could be true...
I'm curious: If you place the space within the control tage, will it be
removed?
Such as:
This is some text before <asp:hyperlink id="hl1" runat="server "
navigateurl="http://www.microsoft.com">This is my link </asp:hyperlink>And
this is my text after the Hyperlink

I know this isn't necessarily a valid solution, but I'm curious as to if the
space will be retained.

-Cliff

"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl...[color=blue]
> Thanks for your comments, Cliff.
>
> No, I said "...not ALWAYS an expectable workaround"
>
> It has nothing to do with the number of keystrokes to type "&nbsp;" The
> difference between having a non-breaking space and not having one could in
> some cases make a difference between your layout looking good and looking
> like crap ;-)
>
> Regards
> Brian W
>
>
> "Cliff Harris" <hersh@myrealbox.com> wrote in message
> news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...[color=green]
> > I have noticed the same problem... it is, at times, inconvenient.
> > However, I do not understand why inserting an &nbsp; character
> > isn't an acceptable workaround? Just a few more keystrokes :)
> >
> >
> > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...[color=darkred]
> > > Yet another editor problem
> > >
> > > To reproduce do the following
> > >
> > > 1) Open a Webform and switch to HTML edit mode
> > >
> > > 2) Enter the Following (include spaces)
> > > This is some text before <asp:hyperlink id="hl1" runat="server[/color][/color][/color]
"[color=blue][color=green][color=darkred]
> > > navigateurl="http://www.microsoft.com">This is my link</asp:hyperlink>[/color][/color]
> And[color=green][color=darkred]
> > > this is my text after the Hyperlink
> > >
> > > 3) Switch back to design mode.
> > > Notice, the space has been remove between the hyperlink and[/color][/color][/color]
the[color=blue][color=green]
> > word[color=darkred]
> > > "And"
> > >
> > > 4) Now, in design mode type a space character between the hyperlink[/color][/color][/color]
and[color=blue][color=green]
> > the[color=darkred]
> > > word "And"
> > >
> > > 5) Switch back to HTML edit mode and notice the IDE placed a &nbsp;[/color][/color]
> where[color=green][color=darkred]
> > > you typed the space character.
> > > This is not always an acceptable workaround.
> > >
> > >
> > > To prove this only happens with the ASP.NET control, perform the[/color][/color]
> following[color=green][color=darkred]
> > > space
> > >
> > > 1) Open the Webform in HTML edit mode again
> > >
> > > 2) Enter the following (include spaces)
> > > This is some text before <a[/color][/color][/color]
href="http://www.microsoft.com">This[color=blue][color=green]
> > is[color=darkred]
> > > my HTML hyperlink</a> And this text appears after the HTML hyperlink.
> > >
> > > 3) Switch to design mode
> > > Notice the space between the hyperlink and the word "And" is
> > > retained, and no &nbsp; characters are inserted.
> > >
> > >
> > > Any recommendations?
> > >
> > > TIA
> > >
> > > Regards
> > > Brian W
> > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Brian W
Guest
 
Posts: n/a
#6: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


Cliff,

This situation is strange...

If I go to HTML mode and enter the space in the control tag then switch to
design mode the space dies not appear. However, when I switch back to HTML
mode the space is retained.

When compiled and run the tag shows the space.

The problem with this approach is the style for hyperlinks (ie underline)
applies to the space character as well.


Regards
Brian W


"Cliff Harris" <hersh@myrealbox.com> wrote in message
news:uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl...[color=blue]
> That could be true...
> I'm curious: If you place the space within the control tage, will it be
> removed?
> Such as:
> This is some text before <asp:hyperlink id="hl1" runat="server "
> navigateurl="http://www.microsoft.com">This is my link </asp:hyperlink>And
> this is my text after the Hyperlink
>
> I know this isn't necessarily a valid solution, but I'm curious as to if[/color]
the[color=blue]
> space will be retained.
>
> -Cliff
>
> "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> news:e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl...[color=green]
> > Thanks for your comments, Cliff.
> >
> > No, I said "...not ALWAYS an expectable workaround"
> >
> > It has nothing to do with the number of keystrokes to type "&nbsp;" The
> > difference between having a non-breaking space and not having one could[/color][/color]
in[color=blue][color=green]
> > some cases make a difference between your layout looking good and[/color][/color]
looking[color=blue][color=green]
> > like crap ;-)
> >
> > Regards
> > Brian W
> >
> >
> > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > I have noticed the same problem... it is, at times, inconvenient.
> > > However, I do not understand why inserting an &nbsp; character
> > > isn't an acceptable workaround? Just a few more keystrokes :)
> > >
> > >
> > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...
> > > > Yet another editor problem
> > > >
> > > > To reproduce do the following
> > > >
> > > > 1) Open a Webform and switch to HTML edit mode
> > > >
> > > > 2) Enter the Following (include spaces)
> > > > This is some text before <asp:hyperlink id="hl1"[/color][/color][/color]
runat="server[color=blue]
> "[color=green][color=darkred]
> > > > navigateurl="http://www.microsoft.com">This is my[/color][/color][/color]
link</asp:hyperlink>[color=blue][color=green]
> > And[color=darkred]
> > > > this is my text after the Hyperlink
> > > >
> > > > 3) Switch back to design mode.
> > > > Notice, the space has been remove between the hyperlink and[/color][/color]
> the[color=green][color=darkred]
> > > word
> > > > "And"
> > > >
> > > > 4) Now, in design mode type a space character between the hyperlink[/color][/color]
> and[color=green][color=darkred]
> > > the
> > > > word "And"
> > > >
> > > > 5) Switch back to HTML edit mode and notice the IDE placed a &nbsp;[/color]
> > where[color=darkred]
> > > > you typed the space character.
> > > > This is not always an acceptable workaround.
> > > >
> > > >
> > > > To prove this only happens with the ASP.NET control, perform the[/color]
> > following[color=darkred]
> > > > space
> > > >
> > > > 1) Open the Webform in HTML edit mode again
> > > >
> > > > 2) Enter the following (include spaces)
> > > > This is some text before <a[/color][/color]
> href="http://www.microsoft.com">This[color=green][color=darkred]
> > > is
> > > > my HTML hyperlink</a> And this text appears after the HTML[/color][/color][/color]
hyperlink.[color=blue][color=green][color=darkred]
> > > >
> > > > 3) Switch to design mode
> > > > Notice the space between the hyperlink and the word "And" is
> > > > retained, and no &nbsp; characters are inserted.
> > > >
> > > >
> > > > Any recommendations?
> > > >
> > > > TIA
> > > >
> > > > Regards
> > > > Brian W
> > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Cliff Harris
Guest
 
Posts: n/a
#7: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


Yeah, I do understand that this is not a feasible option...
I do, however, think I know what's going on here...
I created a test page to try out some spacing issues and came up with the
following:
1. If you have a space before the control tag and after the control tag, it
only keep the one before
2. If you only have a space after the control tag (ie text<asp:textbox
...>Hi</asp:textbox> AfterText), it keeps the space after.

From this, here is my hypothesis:
I think that the IDE doesn't recognize that there is text between the
opening and closing control tags. There for, as far as the IDE is
concerned, in your example, all you have in your html is
This is some text before And this is my text after the Hyperlink
(there are two spaces between "before" and "After")

And since, if you have two spaces in a row in HTML, the second is ignored,
the IDE tries to be slick and remove one of them for you. I'm not sure if
this would count as a "bug"... but it is surely something that they ought to
work on...

What do you think of the theory?

-Cliff

"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl...[color=blue]
> Cliff,
>
> This situation is strange...
>
> If I go to HTML mode and enter the space in the control tag then switch to
> design mode the space dies not appear. However, when I switch back to HTML
> mode the space is retained.
>
> When compiled and run the tag shows the space.
>
> The problem with this approach is the style for hyperlinks (ie underline)
> applies to the space character as well.
>
>
> Regards
> Brian W
>
>
> "Cliff Harris" <hersh@myrealbox.com> wrote in message
> news:uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl...[color=green]
> > That could be true...
> > I'm curious: If you place the space within the control tage, will it be
> > removed?
> > Such as:
> > This is some text before <asp:hyperlink id="hl1" runat="server "
> > navigateurl="http://www.microsoft.com">This is my link[/color][/color]
</asp:hyperlink>And[color=blue][color=green]
> > this is my text after the Hyperlink
> >
> > I know this isn't necessarily a valid solution, but I'm curious as to if[/color]
> the[color=green]
> > space will be retained.
> >
> > -Cliff
> >
> > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > news:e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > Thanks for your comments, Cliff.
> > >
> > > No, I said "...not ALWAYS an expectable workaround"
> > >
> > > It has nothing to do with the number of keystrokes to type "&nbsp;"[/color][/color][/color]
The[color=blue][color=green][color=darkred]
> > > difference between having a non-breaking space and not having one[/color][/color][/color]
could[color=blue]
> in[color=green][color=darkred]
> > > some cases make a difference between your layout looking good and[/color][/color]
> looking[color=green][color=darkred]
> > > like crap ;-)
> > >
> > > Regards
> > > Brian W
> > >
> > >
> > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...
> > > > I have noticed the same problem... it is, at times, inconvenient.
> > > > However, I do not understand why inserting an &nbsp; character
> > > > isn't an acceptable workaround? Just a few more keystrokes :)
> > > >
> > > >
> > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...
> > > > > Yet another editor problem
> > > > >
> > > > > To reproduce do the following
> > > > >
> > > > > 1) Open a Webform and switch to HTML edit mode
> > > > >
> > > > > 2) Enter the Following (include spaces)
> > > > > This is some text before <asp:hyperlink id="hl1"[/color][/color]
> runat="server[color=green]
> > "[color=darkred]
> > > > > navigateurl="http://www.microsoft.com">This is my[/color][/color]
> link</asp:hyperlink>[color=green][color=darkred]
> > > And
> > > > > this is my text after the Hyperlink
> > > > >
> > > > > 3) Switch back to design mode.
> > > > > Notice, the space has been remove between the hyperlink[/color][/color][/color]
and[color=blue][color=green]
> > the[color=darkred]
> > > > word
> > > > > "And"
> > > > >
> > > > > 4) Now, in design mode type a space character between the[/color][/color][/color]
hyperlink[color=blue][color=green]
> > and[color=darkred]
> > > > the
> > > > > word "And"
> > > > >
> > > > > 5) Switch back to HTML edit mode and notice the IDE placed a[/color][/color][/color]
&nbsp;[color=blue][color=green][color=darkred]
> > > where
> > > > > you typed the space character.
> > > > > This is not always an acceptable workaround.
> > > > >
> > > > >
> > > > > To prove this only happens with the ASP.NET control, perform the
> > > following
> > > > > space
> > > > >
> > > > > 1) Open the Webform in HTML edit mode again
> > > > >
> > > > > 2) Enter the following (include spaces)
> > > > > This is some text before <a[/color]
> > href="http://www.microsoft.com">This[color=darkred]
> > > > is
> > > > > my HTML hyperlink</a> And this text appears after the HTML[/color][/color]
> hyperlink.[color=green][color=darkred]
> > > > >
> > > > > 3) Switch to design mode
> > > > > Notice the space between the hyperlink and the word "And"[/color][/color][/color]
is[color=blue][color=green][color=darkred]
> > > > > retained, and no &nbsp; characters are inserted.
> > > > >
> > > > >
> > > > > Any recommendations?
> > > > >
> > > > > TIA
> > > > >
> > > > > Regards
> > > > > Brian W
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Brian W
Guest
 
Posts: n/a
#8: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


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
to, or not. It is also unreasonable that this formatting cannot be switched
off!

I have been through this code-formatting issue with someone with MS before,
after they understood the problem they decided it wasn't important enough to
fix!


Regards
Brian W



"Cliff Harris" <hersh@myrealbox.com> wrote in message
news:O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl...[color=blue]
> Yeah, I do understand that this is not a feasible option...
> I do, however, think I know what's going on here...
> I created a test page to try out some spacing issues and came up with the
> following:
> 1. If you have a space before the control tag and after the control tag,[/color]
it[color=blue]
> only keep the one before
> 2. If you only have a space after the control tag (ie text<asp:textbox
> ..>Hi</asp:textbox> AfterText), it keeps the space after.
>
> From this, here is my hypothesis:
> I think that the IDE doesn't recognize that there is text between the
> opening and closing control tags. There for, as far as the IDE is
> concerned, in your example, all you have in your html is
> This is some text before And this is my text after the Hyperlink
> (there are two spaces between "before" and "After")
>
> And since, if you have two spaces in a row in HTML, the second is ignored,
> the IDE tries to be slick and remove one of them for you. I'm not sure if
> this would count as a "bug"... but it is surely something that they ought[/color]
to[color=blue]
> work on...
>
> What do you think of the theory?
>
> -Cliff
>
> "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> news:e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl...[color=green]
> > Cliff,
> >
> > This situation is strange...
> >
> > If I go to HTML mode and enter the space in the control tag then switch[/color][/color]
to[color=blue][color=green]
> > design mode the space dies not appear. However, when I switch back to[/color][/color]
HTML[color=blue][color=green]
> > mode the space is retained.
> >
> > When compiled and run the tag shows the space.
> >
> > The problem with this approach is the style for hyperlinks (ie[/color][/color]
underline)[color=blue][color=green]
> > applies to the space character as well.
> >
> >
> > Regards
> > Brian W
> >
> >
> > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > news:uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > That could be true...
> > > I'm curious: If you place the space within the control tage, will it[/color][/color][/color]
be[color=blue][color=green][color=darkred]
> > > removed?
> > > Such as:
> > > This is some text before <asp:hyperlink id="hl1" runat="server "
> > > navigateurl="http://www.microsoft.com">This is my link[/color][/color]
> </asp:hyperlink>And[color=green][color=darkred]
> > > this is my text after the Hyperlink
> > >
> > > I know this isn't necessarily a valid solution, but I'm curious as to[/color][/color][/color]
if[color=blue][color=green]
> > the[color=darkred]
> > > space will be retained.
> > >
> > > -Cliff
> > >
> > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > news:e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl...
> > > > Thanks for your comments, Cliff.
> > > >
> > > > No, I said "...not ALWAYS an expectable workaround"
> > > >
> > > > It has nothing to do with the number of keystrokes to type "&nbsp;"[/color][/color]
> The[color=green][color=darkred]
> > > > difference between having a non-breaking space and not having one[/color][/color]
> could[color=green]
> > in[color=darkred]
> > > > some cases make a difference between your layout looking good and[/color]
> > looking[color=darkred]
> > > > like crap ;-)
> > > >
> > > > Regards
> > > > Brian W
> > > >
> > > >
> > > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > > news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...
> > > > > I have noticed the same problem... it is, at times, inconvenient.
> > > > > However, I do not understand why inserting an &nbsp; character
> > > > > isn't an acceptable workaround? Just a few more keystrokes :)
> > > > >
> > > > >
> > > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > > news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...
> > > > > > Yet another editor problem
> > > > > >
> > > > > > To reproduce do the following
> > > > > >
> > > > > > 1) Open a Webform and switch to HTML edit mode
> > > > > >
> > > > > > 2) Enter the Following (include spaces)
> > > > > > This is some text before <asp:hyperlink id="hl1"[/color]
> > runat="server[color=darkred]
> > > "
> > > > > > navigateurl="http://www.microsoft.com">This is my[/color]
> > link</asp:hyperlink>[color=darkred]
> > > > And
> > > > > > this is my text after the Hyperlink
> > > > > >
> > > > > > 3) Switch back to design mode.
> > > > > > Notice, the space has been remove between the hyperlink[/color][/color]
> and[color=green][color=darkred]
> > > the
> > > > > word
> > > > > > "And"
> > > > > >
> > > > > > 4) Now, in design mode type a space character between the[/color][/color]
> hyperlink[color=green][color=darkred]
> > > and
> > > > > the
> > > > > > word "And"
> > > > > >
> > > > > > 5) Switch back to HTML edit mode and notice the IDE placed a[/color][/color]
> &nbsp;[color=green][color=darkred]
> > > > where
> > > > > > you typed the space character.
> > > > > > This is not always an acceptable workaround.
> > > > > >
> > > > > >
> > > > > > To prove this only happens with the ASP.NET control, perform the
> > > > following
> > > > > > space
> > > > > >
> > > > > > 1) Open the Webform in HTML edit mode again
> > > > > >
> > > > > > 2) Enter the following (include spaces)
> > > > > > This is some text before <a
> > > href="http://www.microsoft.com">This
> > > > > is
> > > > > > my HTML hyperlink</a> And this text appears after the HTML[/color]
> > hyperlink.[color=darkred]
> > > > > >
> > > > > > 3) Switch to design mode
> > > > > > Notice the space between the hyperlink and the word[/color][/color][/color]
"And"[color=blue]
> is[color=green][color=darkred]
> > > > > > retained, and no &nbsp; characters are inserted.
> > > > > >
> > > > > >
> > > > > > Any recommendations?
> > > > > >
> > > > > > TIA
> > > > > >
> > > > > > Regards
> > > > > > Brian W
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Mike Moore [MSFT]
Guest
 
Posts: n/a
#9: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


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.


--------------------[color=blue]
> From: "Brian W" <brianw@gold_death_2_spam_rush.com>
> References: <O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl>[/color]
<#ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl>
<e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl>
<uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl>
<e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl>
<O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl>[color=blue]
> 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: <OGsVOWWqDHA.644@TK2MSFTNGP11.phx.gbl>
> Newsgroups: microsoft.public.dotnet.framework.aspnet
> NNTP-Posting-Host: dsl-107.goldrush.com 206.171.170.107
> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.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
> to, or not. It is also unreasonable that this formatting cannot be[/color]
switched[color=blue]
> off!
>
> I have been through this code-formatting issue with someone with MS[/color]
before,[color=blue]
> after they understood the problem they decided it wasn't important enough[/color]
to[color=blue]
> fix!
>
>
> Regards
> Brian W
>
>
>
> "Cliff Harris" <hersh@myrealbox.com> wrote in message
> news:O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl...[color=green]
> > Yeah, I do understand that this is not a feasible option...
> > I do, however, think I know what's going on here...
> > I created a test page to try out some spacing issues and came up with[/color][/color]
the[color=blue][color=green]
> > following:
> > 1. If you have a space before the control tag and after the control tag,[/color]
> it[color=green]
> > only keep the one before
> > 2. If you only have a space after the control tag (ie text<asp:textbox
> > ..>Hi</asp:textbox> AfterText), it keeps the space after.
> >
> > From this, here is my hypothesis:
> > I think that the IDE doesn't recognize that there is text between the
> > opening and closing control tags. There for, as far as the IDE is
> > concerned, in your example, all you have in your html is
> > This is some text before And this is my text after the Hyperlink
> > (there are two spaces between "before" and "After")
> >
> > And since, if you have two spaces in a row in HTML, the second is[/color][/color]
ignored,[color=blue][color=green]
> > the IDE tries to be slick and remove one of them for you. I'm not sure[/color][/color]
if[color=blue][color=green]
> > this would count as a "bug"... but it is surely something that they[/color][/color]
ought[color=blue]
> to[color=green]
> > work on...
> >
> > What do you think of the theory?
> >
> > -Cliff
> >
> > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > news:e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > Cliff,
> > >
> > > This situation is strange...
> > >
> > > If I go to HTML mode and enter the space in the control tag then[/color][/color][/color]
switch[color=blue]
> to[color=green][color=darkred]
> > > design mode the space dies not appear. However, when I switch back to[/color][/color]
> HTML[color=green][color=darkred]
> > > mode the space is retained.
> > >
> > > When compiled and run the tag shows the space.
> > >
> > > The problem with this approach is the style for hyperlinks (ie[/color][/color]
> underline)[color=green][color=darkred]
> > > applies to the space character as well.
> > >
> > >
> > > Regards
> > > Brian W
> > >
> > >
> > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > news:uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl...
> > > > That could be true...
> > > > I'm curious: If you place the space within the control tage, will[/color][/color][/color]
it[color=blue]
> be[color=green][color=darkred]
> > > > removed?
> > > > Such as:
> > > > This is some text before <asp:hyperlink id="hl1" runat="server "
> > > > navigateurl="http://www.microsoft.com">This is my link[/color]
> > </asp:hyperlink>And[color=darkred]
> > > > this is my text after the Hyperlink
> > > >
> > > > I know this isn't necessarily a valid solution, but I'm curious as[/color][/color][/color]
to[color=blue]
> if[color=green][color=darkred]
> > > the
> > > > space will be retained.
> > > >
> > > > -Cliff
> > > >
> > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > news:e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl...
> > > > > Thanks for your comments, Cliff.
> > > > >
> > > > > No, I said "...not ALWAYS an expectable workaround"
> > > > >
> > > > > It has nothing to do with the number of keystrokes to type[/color][/color][/color]
"&nbsp;"[color=blue][color=green]
> > The[color=darkred]
> > > > > difference between having a non-breaking space and not having one[/color]
> > could[color=darkred]
> > > in
> > > > > some cases make a difference between your layout looking good and
> > > looking
> > > > > like crap ;-)
> > > > >
> > > > > Regards
> > > > > Brian W
> > > > >
> > > > >
> > > > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > > > news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...
> > > > > > I have noticed the same problem... it is, at times,[/color][/color][/color]
inconvenient.[color=blue][color=green][color=darkred]
> > > > > > However, I do not understand why inserting an &nbsp; character
> > > > > > isn't an acceptable workaround? Just a few more keystrokes :)
> > > > > >
> > > > > >
> > > > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > > > news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...
> > > > > > > Yet another editor problem
> > > > > > >
> > > > > > > To reproduce do the following
> > > > > > >
> > > > > > > 1) Open a Webform and switch to HTML edit mode
> > > > > > >
> > > > > > > 2) Enter the Following (include spaces)
> > > > > > > This is some text before <asp:hyperlink id="hl1"
> > > runat="server
> > > > "
> > > > > > > navigateurl="http://www.microsoft.com">This is my
> > > link</asp:hyperlink>
> > > > > And
> > > > > > > this is my text after the Hyperlink
> > > > > > >
> > > > > > > 3) Switch back to design mode.
> > > > > > > Notice, the space has been remove between the[/color][/color][/color]
hyperlink[color=blue][color=green]
> > and[color=darkred]
> > > > the
> > > > > > word
> > > > > > > "And"
> > > > > > >
> > > > > > > 4) Now, in design mode type a space character between the[/color]
> > hyperlink[color=darkred]
> > > > and
> > > > > > the
> > > > > > > word "And"
> > > > > > >
> > > > > > > 5) Switch back to HTML edit mode and notice the IDE placed a[/color]
> > &nbsp;[color=darkred]
> > > > > where
> > > > > > > you typed the space character.
> > > > > > > This is not always an acceptable workaround.
> > > > > > >
> > > > > > >
> > > > > > > To prove this only happens with the ASP.NET control, perform[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > > > following
> > > > > > > space
> > > > > > >
> > > > > > > 1) Open the Webform in HTML edit mode again
> > > > > > >
> > > > > > > 2) Enter the following (include spaces)
> > > > > > > This is some text before <a
> > > > href="http://www.microsoft.com">This
> > > > > > is
> > > > > > > my HTML hyperlink</a> And this text appears after the HTML
> > > hyperlink.
> > > > > > >
> > > > > > > 3) Switch to design mode
> > > > > > > Notice the space between the hyperlink and the word[/color][/color]
> "And"[color=green]
> > is[color=darkred]
> > > > > > > retained, and no &nbsp; characters are inserted.
> > > > > > >
> > > > > > >
> > > > > > > Any recommendations?
> > > > > > >
> > > > > > > TIA
> > > > > > >
> > > > > > > Regards
> > > > > > > Brian W
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>
>[/color]

Brian W
Guest
 
Posts: n/a
#10: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


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]"" <michmo@online.microsoft.com> wrote in message
news:y5N23pgqDHA.1992@cpmsftngxa06.phx.gbl...[color=blue]
> 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[/color]
problem.[color=blue]
>
> 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[/color]
and[color=blue]
> these changes are mostly in a single undo entry. Calling undo then[/color]
reverses[color=blue]
> 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[/color]
the[color=blue]
> 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[/color]
straightforward[color=blue]
> steps listed to improve your computer's security.
>
> This posting is provided "AS IS", with no warranties, and confers no[/color]
rights.[color=blue]
>
>
> --------------------[color=green]
> > From: "Brian W" <brianw@gold_death_2_spam_rush.com>
> > References: <O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl>[/color]
> <#ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl>
> <e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl>
> <uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl>
> <e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl>
> <O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl>[color=green]
> > 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: <OGsVOWWqDHA.644@TK2MSFTNGP11.phx.gbl>
> > Newsgroups: microsoft.public.dotnet.framework.aspnet
> > NNTP-Posting-Host: dsl-107.goldrush.com 206.171.170.107
> > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
> > Xref: cpmsftngxa06.phx.gbl[/color][/color]
microsoft.public.dotnet.framework.aspnet:190501[color=blue][color=green]
> > 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[/color][/color]
you[color=blue][color=green]
> > 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[/color][/color]
it[color=blue][color=green]
> > to, or not. It is also unreasonable that this formatting cannot be[/color]
> switched[color=green]
> > off!
> >
> > I have been through this code-formatting issue with someone with MS[/color]
> before,[color=green]
> > after they understood the problem they decided it wasn't important[/color][/color]
enough[color=blue]
> to[color=green]
> > fix!
> >
> >
> > Regards
> > Brian W
> >
> >
> >
> > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > news:O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl...[color=darkred]
> > > Yeah, I do understand that this is not a feasible option...
> > > I do, however, think I know what's going on here...
> > > I created a test page to try out some spacing issues and came up with[/color][/color]
> the[color=green][color=darkred]
> > > following:
> > > 1. If you have a space before the control tag and after the control[/color][/color][/color]
tag,[color=blue][color=green]
> > it[color=darkred]
> > > only keep the one before
> > > 2. If you only have a space after the control tag (ie text<asp:textbox
> > > ..>Hi</asp:textbox> AfterText), it keeps the space after.
> > >
> > > From this, here is my hypothesis:
> > > I think that the IDE doesn't recognize that there is text between the
> > > opening and closing control tags. There for, as far as the IDE is
> > > concerned, in your example, all you have in your html is
> > > This is some text before And this is my text after the Hyperlink
> > > (there are two spaces between "before" and "After")
> > >
> > > And since, if you have two spaces in a row in HTML, the second is[/color][/color]
> ignored,[color=green][color=darkred]
> > > the IDE tries to be slick and remove one of them for you. I'm not[/color][/color][/color]
sure[color=blue]
> if[color=green][color=darkred]
> > > this would count as a "bug"... but it is surely something that they[/color][/color]
> ought[color=green]
> > to[color=darkred]
> > > work on...
> > >
> > > What do you think of the theory?
> > >
> > > -Cliff
> > >
> > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > news:e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl...
> > > > Cliff,
> > > >
> > > > This situation is strange...
> > > >
> > > > If I go to HTML mode and enter the space in the control tag then[/color][/color]
> switch[color=green]
> > to[color=darkred]
> > > > design mode the space dies not appear. However, when I switch back[/color][/color][/color]
to[color=blue][color=green]
> > HTML[color=darkred]
> > > > mode the space is retained.
> > > >
> > > > When compiled and run the tag shows the space.
> > > >
> > > > The problem with this approach is the style for hyperlinks (ie[/color]
> > underline)[color=darkred]
> > > > applies to the space character as well.
> > > >
> > > >
> > > > Regards
> > > > Brian W
> > > >
> > > >
> > > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > > news:uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl...
> > > > > That could be true...
> > > > > I'm curious: If you place the space within the control tage, will[/color][/color]
> it[color=green]
> > be[color=darkred]
> > > > > removed?
> > > > > Such as:
> > > > > This is some text before <asp:hyperlink id="hl1" runat="server "
> > > > > navigateurl="http://www.microsoft.com">This is my link
> > > </asp:hyperlink>And
> > > > > this is my text after the Hyperlink
> > > > >
> > > > > I know this isn't necessarily a valid solution, but I'm curious as[/color][/color]
> to[color=green]
> > if[color=darkred]
> > > > the
> > > > > space will be retained.
> > > > >
> > > > > -Cliff
> > > > >
> > > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > > news:e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl...
> > > > > > Thanks for your comments, Cliff.
> > > > > >
> > > > > > No, I said "...not ALWAYS an expectable workaround"
> > > > > >
> > > > > > It has nothing to do with the number of keystrokes to type[/color][/color]
> "&nbsp;"[color=green][color=darkred]
> > > The
> > > > > > difference between having a non-breaking space and not having[/color][/color][/color]
one[color=blue][color=green][color=darkred]
> > > could
> > > > in
> > > > > > some cases make a difference between your layout looking good[/color][/color][/color]
and[color=blue][color=green][color=darkred]
> > > > looking
> > > > > > like crap ;-)
> > > > > >
> > > > > > Regards
> > > > > > Brian W
> > > > > >
> > > > > >
> > > > > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > > > > news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...
> > > > > > > I have noticed the same problem... it is, at times,[/color][/color]
> inconvenient.[color=green][color=darkred]
> > > > > > > However, I do not understand why inserting an &nbsp; character
> > > > > > > isn't an acceptable workaround? Just a few more keystrokes :)
> > > > > > >
> > > > > > >
> > > > > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > > > > news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...
> > > > > > > > Yet another editor problem
> > > > > > > >
> > > > > > > > To reproduce do the following
> > > > > > > >
> > > > > > > > 1) Open a Webform and switch to HTML edit mode
> > > > > > > >
> > > > > > > > 2) Enter the Following (include spaces)
> > > > > > > > This is some text before <asp:hyperlink id="hl1"
> > > > runat="server
> > > > > "
> > > > > > > > navigateurl="http://www.microsoft.com">This is my
> > > > link</asp:hyperlink>
> > > > > > And
> > > > > > > > this is my text after the Hyperlink
> > > > > > > >
> > > > > > > > 3) Switch back to design mode.
> > > > > > > > Notice, the space has been remove between the[/color][/color]
> hyperlink[color=green][color=darkred]
> > > and
> > > > > the
> > > > > > > word
> > > > > > > > "And"
> > > > > > > >
> > > > > > > > 4) Now, in design mode type a space character between the
> > > hyperlink
> > > > > and
> > > > > > > the
> > > > > > > > word "And"
> > > > > > > >
> > > > > > > > 5) Switch back to HTML edit mode and notice the IDE placed[/color][/color][/color]
a[color=blue][color=green][color=darkred]
> > > &nbsp;
> > > > > > where
> > > > > > > > you typed the space character.
> > > > > > > > This is not always an acceptable workaround.
> > > > > > > >
> > > > > > > >
> > > > > > > > To prove this only happens with the ASP.NET control, perform[/color][/color]
> the[color=green][color=darkred]
> > > > > > following
> > > > > > > > space
> > > > > > > >
> > > > > > > > 1) Open the Webform in HTML edit mode again
> > > > > > > >
> > > > > > > > 2) Enter the following (include spaces)
> > > > > > > > This is some text before <a
> > > > > href="http://www.microsoft.com">This
> > > > > > > is
> > > > > > > > my HTML hyperlink</a> And this text appears after the HTML
> > > > hyperlink.
> > > > > > > >
> > > > > > > > 3) Switch to design mode
> > > > > > > > Notice the space between the hyperlink and the word[/color]
> > "And"[color=darkred]
> > > is
> > > > > > > > retained, and no &nbsp; characters are inserted.
> > > > > > > >
> > > > > > > >
> > > > > > > > Any recommendations?
> > > > > > > >
> > > > > > > > TIA
> > > > > > > >
> > > > > > > > Regards
> > > > > > > > Brian W
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >
> >[/color]
>[/color]


Mike Moore [MSFT]
Guest
 
Posts: n/a
#11: Nov 17 '05

re: Use of ASP.NET control does not preserve whitespace.


Hi Brian,

I just tested your code snippet on my machine and I saw the space both
before and after the hyperlink in the browser. I'm running .NET 1.1 on
Win2003 server.

I will setup win2000 with .NET 1.0 and 1.1 to see if the problem occurs for
me on either of them. I'll let you know the results.

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.


--------------------[color=blue]
> From: "Brian W" <brianw@gold_death_2_spam_rush.com>
> References: <O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl>[/color]
<#ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl>
<e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl>
<uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl>
<e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl>
<O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl>
<OGsVOWWqDHA.644@TK2MSFTNGP11.phx.gbl>
<y5N23pgqDHA.1992@cpmsftngxa06.phx.gbl>[color=blue]
> 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: <OeniSKhqDHA.2692@TK2MSFTNGP09.phx.gbl>
> Newsgroups: microsoft.public.dotnet.framework.aspnet
> NNTP-Posting-Host: dsl-107.goldrush.com 206.171.170.107
> Path:[/color]
cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
phx.gbl!TK2MSFTNGP09.phx.gbl[color=blue]
> 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[/color]
editor.[color=blue]
>
> 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[/color]
line[color=blue]
> of code). Then I save (never switching to design mode) then compile and[/color]
run[color=blue]
> 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,[/color]
tab,[color=blue]
> etc. the output should show a whitespace between these words, there is[/color]
not.[color=blue]
>
> This is, in all likelihood, a compiler issue. As I said in my original[/color]
post,[color=blue]
> if I replace the <asp:hyperlink> with an <a> tag the whitspace is[/color]
retained.[color=blue]
>
> 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[/color]
VS.NET[color=blue]
> to edit ASP.NET pages.
>
>
> Regards
> Brian W
>
>
>
>
> ""Mike Moore [MSFT]"" <michmo@online.microsoft.com> wrote in message
> news:y5N23pgqDHA.1992@cpmsftngxa06.phx.gbl...[color=green]
> > 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[/color][/color]
you.[color=blue][color=green]
> > We make the best products that we can. Being large & complex, it's hard[/color][/color]
to[color=blue][color=green]
> > make these products perfect in every way.
> >
> > There are two "partial" workarounds. These help, but do not fix the[/color]
> problem.[color=green]
> >
> > 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[/color]
> and[color=green]
> > these changes are mostly in a single undo entry. Calling undo then[/color]
> reverses[color=green]
> > 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[/color]
> the[color=green]
> > reformatting feature. Unfortunately, it turned out to be deeply[/color][/color]
integrated[color=blue][color=green]
> > in the code that makes the editor useful. So, it could not be turned[/color][/color]
off.[color=blue][color=green]
> > 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[/color][/color]
the[color=blue][color=green]
> > 1.1 release would cause more harm than good.
> >
> > This continues to be considered an important item. So, I expect it will[/color][/color]
be[color=blue][color=green]
> > 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[/color]
> straightforward[color=green]
> > steps listed to improve your computer's security.
> >
> > This posting is provided "AS IS", with no warranties, and confers no[/color]
> rights.[color=green]
> >
> >
> > --------------------[color=darkred]
> > > From: "Brian W" <brianw@gold_death_2_spam_rush.com>
> > > References: <O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl>[/color]
> > <#ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl>
> > <e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl>
> > <uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl>
> > <e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl>
> > <O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl>[color=darkred]
> > > 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: <OGsVOWWqDHA.644@TK2MSFTNGP11.phx.gbl>
> > > Newsgroups: microsoft.public.dotnet.framework.aspnet
> > > NNTP-Posting-Host: dsl-107.goldrush.com 206.171.170.107
> > > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
> > > Xref: cpmsftngxa06.phx.gbl[/color][/color]
> microsoft.public.dotnet.framework.aspnet:190501[color=green][color=darkred]
> > > 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[/color][/color]
> you[color=green][color=darkred]
> > > get the desired result.
> > >
> > > The problem here is that if you switch to design mode this formatting[/color][/color][/color]
is[color=blue][color=green][color=darkred]
> > > 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[/color][/color][/color]
what[color=blue]
> it[color=green][color=darkred]
> > > to, or not. It is also unreasonable that this formatting cannot be[/color]
> > switched[color=darkred]
> > > off!
> > >
> > > I have been through this code-formatting issue with someone with MS[/color]
> > before,[color=darkred]
> > > after they understood the problem they decided it wasn't important[/color][/color]
> enough[color=green]
> > to[color=darkred]
> > > fix!
> > >
> > >
> > > Regards
> > > Brian W
> > >
> > >
> > >
> > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > news:O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl...
> > > > Yeah, I do understand that this is not a feasible option...
> > > > I do, however, think I know what's going on here...
> > > > I created a test page to try out some spacing issues and came up[/color][/color][/color]
with[color=blue][color=green]
> > the[color=darkred]
> > > > following:
> > > > 1. If you have a space before the control tag and after the control[/color][/color]
> tag,[color=green][color=darkred]
> > > it
> > > > only keep the one before
> > > > 2. If you only have a space after the control tag (ie[/color][/color][/color]
text<asp:textbox[color=blue][color=green][color=darkred]
> > > > ..>Hi</asp:textbox> AfterText), it keeps the space after.
> > > >
> > > > From this, here is my hypothesis:
> > > > I think that the IDE doesn't recognize that there is text between[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > > opening and closing control tags. There for, as far as the IDE is
> > > > concerned, in your example, all you have in your html is
> > > > This is some text before And this is my text after the Hyperlink
> > > > (there are two spaces between "before" and "After")
> > > >
> > > > And since, if you have two spaces in a row in HTML, the second is[/color]
> > ignored,[color=darkred]
> > > > the IDE tries to be slick and remove one of them for you. I'm not[/color][/color]
> sure[color=green]
> > if[color=darkred]
> > > > this would count as a "bug"... but it is surely something that they[/color]
> > ought[color=darkred]
> > > to
> > > > work on...
> > > >
> > > > What do you think of the theory?
> > > >
> > > > -Cliff
> > > >
> > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > news:e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl...
> > > > > Cliff,
> > > > >
> > > > > This situation is strange...
> > > > >
> > > > > If I go to HTML mode and enter the space in the control tag then[/color]
> > switch[color=darkred]
> > > to
> > > > > design mode the space dies not appear. However, when I switch back[/color][/color]
> to[color=green][color=darkred]
> > > HTML
> > > > > mode the space is retained.
> > > > >
> > > > > When compiled and run the tag shows the space.
> > > > >
> > > > > The problem with this approach is the style for hyperlinks (ie
> > > underline)
> > > > > applies to the space character as well.
> > > > >
> > > > >
> > > > > Regards
> > > > > Brian W
> > > > >
> > > > >
> > > > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > > > news:uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl...
> > > > > > That could be true...
> > > > > > I'm curious: If you place the space within the control tage,[/color][/color][/color]
will[color=blue][color=green]
> > it[color=darkred]
> > > be
> > > > > > removed?
> > > > > > Such as:
> > > > > > This is some text before <asp:hyperlink id="hl1" runat="server[/color][/color][/color]
"[color=blue][color=green][color=darkred]
> > > > > > navigateurl="http://www.microsoft.com">This is my link
> > > > </asp:hyperlink>And
> > > > > > this is my text after the Hyperlink
> > > > > >
> > > > > > I know this isn't necessarily a valid solution, but I'm curious[/color][/color][/color]
as[color=blue][color=green]
> > to[color=darkred]
> > > if
> > > > > the
> > > > > > space will be retained.
> > > > > >
> > > > > > -Cliff
> > > > > >
> > > > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > > > news:e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl...
> > > > > > > Thanks for your comments, Cliff.
> > > > > > >
> > > > > > > No, I said "...not ALWAYS an expectable workaround"
> > > > > > >
> > > > > > > It has nothing to do with the number of keystrokes to type[/color]
> > "&nbsp;"[color=darkred]
> > > > The
> > > > > > > difference between having a non-breaking space and not having[/color][/color]
> one[color=green][color=darkred]
> > > > could
> > > > > in
> > > > > > > some cases make a difference between your layout looking good[/color][/color]
> and[color=green][color=darkred]
> > > > > looking
> > > > > > > like crap ;-)
> > > > > > >
> > > > > > > Regards
> > > > > > > Brian W
> > > > > > >
> > > > > > >
> > > > > > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > > > > > news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...
> > > > > > > > I have noticed the same problem... it is, at times,[/color]
> > inconvenient.[color=darkred]
> > > > > > > > However, I do not understand why inserting an &nbsp;[/color][/color][/color]
character[color=blue][color=green][color=darkred]
> > > > > > > > isn't an acceptable workaround? Just a few more keystrokes[/color][/color][/color]
:)[color=blue][color=green][color=darkred]
> > > > > > > >
> > > > > > > >
> > > > > > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in[/color][/color][/color]
message[color=blue][color=green][color=darkred]
> > > > > > > > news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...
> > > > > > > > > Yet another editor problem
> > > > > > > > >
> > > > > > > > > To reproduce do the following
> > > > > > > > >
> > > > > > > > > 1) Open a Webform and switch to HTML edit mode
> > > > > > > > >
> > > > > > > > > 2) Enter the Following (include spaces)
> > > > > > > > > This is some text before <asp:hyperlink id="hl1"
> > > > > runat="server
> > > > > > "
> > > > > > > > > navigateurl="http://www.microsoft.com">This is my
> > > > > link</asp:hyperlink>
> > > > > > > And
> > > > > > > > > this is my text after the Hyperlink
> > > > > > > > >
> > > > > > > > > 3) Switch back to design mode.
> > > > > > > > > Notice, the space has been remove between the[/color]
> > hyperlink[color=darkred]
> > > > and
> > > > > > the
> > > > > > > > word
> > > > > > > > > "And"
> > > > > > > > >
> > > > > > > > > 4) Now, in design mode type a space character between the
> > > > hyperlink
> > > > > > and
> > > > > > > > the
> > > > > > > > > word "And"
> > > > > > > > >
> > > > > > > > > 5) Switch back to HTML edit mode and notice the IDE[/color][/color][/color]
placed[color=blue]
> a[color=green][color=darkred]
> > > > &nbsp;
> > > > > > > where
> > > > > > > > > you typed the space character.
> > > > > > > > > This is not always an acceptable workaround.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > To prove this only happens with the ASP.NET control,[/color][/color][/color]
perform[color=blue][color=green]
> > the[color=darkred]
> > > > > > > following
> > > > > > > > > space
> > > > > > > > >
> > > > > > > > > 1) Open the Webform in HTML edit mode again
> > > > > > > > >
> > > > > > > > > 2) Enter the following (include spaces)
> > > > > > > > > This is some text before <a
> > > > > > href="http://www.microsoft.com">This
> > > > > > > > is
> > > > > > > > > my HTML hyperlink</a> And this text appears after the HTML
> > > > > hyperlink.
> > > > > > > > >
> > > > > > > > > 3) Switch to design mode
> > > > > > > > > Notice the space between the hyperlink and the[/color][/color][/color]
word[color=blue][color=green][color=darkred]
> > > "And"
> > > > is
> > > > > > > > > retained, and no &nbsp; characters are inserted.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Any recommendations?
> > > > > > > > >
> > > > > > > > > TIA
> > > > > > > > >
> > > > > > > > > Regards
> > > > > > > > > Brian W
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >[/color]
> >[/color]
>
>
>[/color]

Mike Moore [MSFT]
Guest
 
Posts: n/a
#12: Nov 18 '05

re: Use of ASP.NET control does not preserve whitespace.


Hi Brian,

I tested this on two machines and saw spaces before and after the
hyperlink. I used the code snippet which you posted.

1) version 1.1 of .NET on Win2003 server
2) version 1.0 sp2 of .NET on Win2000 professional

Can you retest on another machine?

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.


--------------------[color=blue]
> From: "Brian W" <brianw@gold_death_2_spam_rush.com>
> References: <O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl>[/color]
<#ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl>
<e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl>
<uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl>
<e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl>
<O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl>
<OGsVOWWqDHA.644@TK2MSFTNGP11.phx.gbl>
<y5N23pgqDHA.1992@cpmsftngxa06.phx.gbl>[color=blue]
> 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: <OeniSKhqDHA.2692@TK2MSFTNGP09.phx.gbl>
> Newsgroups: microsoft.public.dotnet.framework.aspnet
> NNTP-Posting-Host: dsl-107.goldrush.com 206.171.170.107
> Path:[/color]
cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!TK2MSFTNGP09.phx.gbl[color=blue]
> 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[/color]
editor.[color=blue]
>
> 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[/color]
line[color=blue]
> of code). Then I save (never switching to design mode) then compile and[/color]
run[color=blue]
> 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,[/color]
tab,[color=blue]
> etc. the output should show a whitespace between these words, there is[/color]
not.[color=blue]
>
> This is, in all likelihood, a compiler issue. As I said in my original[/color]
post,[color=blue]
> if I replace the <asp:hyperlink> with an <a> tag the whitspace is[/color]
retained.[color=blue]
>
> 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[/color]
VS.NET[color=blue]
> to edit ASP.NET pages.
>
>
> Regards
> Brian W
>
>
>
>
> ""Mike Moore [MSFT]"" <michmo@online.microsoft.com> wrote in message
> news:y5N23pgqDHA.1992@cpmsftngxa06.phx.gbl...[color=green]
> > 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[/color][/color]
you.[color=blue][color=green]
> > We make the best products that we can. Being large & complex, it's hard[/color][/color]
to[color=blue][color=green]
> > make these products perfect in every way.
> >
> > There are two "partial" workarounds. These help, but do not fix the[/color]
> problem.[color=green]
> >
> > 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[/color]
> and[color=green]
> > these changes are mostly in a single undo entry. Calling undo then[/color]
> reverses[color=green]
> > 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[/color]
> the[color=green]
> > reformatting feature. Unfortunately, it turned out to be deeply[/color][/color]
integrated[color=blue][color=green]
> > in the code that makes the editor useful. So, it could not be turned[/color][/color]
off.[color=blue][color=green]
> > 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[/color][/color]
the[color=blue][color=green]
> > 1.1 release would cause more harm than good.
> >
> > This continues to be considered an important item. So, I expect it will[/color][/color]
be[color=blue][color=green]
> > 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[/color]
> straightforward[color=green]
> > steps listed to improve your computer's security.
> >
> > This posting is provided "AS IS", with no warranties, and confers no[/color]
> rights.[color=green]
> >
> >
> > --------------------[color=darkred]
> > > From: "Brian W" <brianw@gold_death_2_spam_rush.com>
> > > References: <O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl>[/color]
> > <#ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl>
> > <e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl>
> > <uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl>
> > <e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl>
> > <O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl>[color=darkred]
> > > 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: <OGsVOWWqDHA.644@TK2MSFTNGP11.phx.gbl>
> > > Newsgroups: microsoft.public.dotnet.framework.aspnet
> > > NNTP-Posting-Host: dsl-107.goldrush.com 206.171.170.107
> > > Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
> > > Xref: cpmsftngxa06.phx.gbl[/color][/color]
> microsoft.public.dotnet.framework.aspnet:190501[color=green][color=darkred]
> > > 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[/color][/color]
> you[color=green][color=darkred]
> > > get the desired result.
> > >
> > > The problem here is that if you switch to design mode this formatting[/color][/color][/color]
is[color=blue][color=green][color=darkred]
> > > 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[/color][/color][/color]
what[color=blue]
> it[color=green][color=darkred]
> > > to, or not. It is also unreasonable that this formatting cannot be[/color]
> > switched[color=darkred]
> > > off!
> > >
> > > I have been through this code-formatting issue with someone with MS[/color]
> > before,[color=darkred]
> > > after they understood the problem they decided it wasn't important[/color][/color]
> enough[color=green]
> > to[color=darkred]
> > > fix!
> > >
> > >
> > > Regards
> > > Brian W
> > >
> > >
> > >
> > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > news:O$rwANWqDHA.1928@TK2MSFTNGP12.phx.gbl...
> > > > Yeah, I do understand that this is not a feasible option...
> > > > I do, however, think I know what's going on here...
> > > > I created a test page to try out some spacing issues and came up[/color][/color][/color]
with[color=blue][color=green]
> > the[color=darkred]
> > > > following:
> > > > 1. If you have a space before the control tag and after the control[/color][/color]
> tag,[color=green][color=darkred]
> > > it
> > > > only keep the one before
> > > > 2. If you only have a space after the control tag (ie[/color][/color][/color]
text<asp:textbox[color=blue][color=green][color=darkred]
> > > > ..>Hi</asp:textbox> AfterText), it keeps the space after.
> > > >
> > > > From this, here is my hypothesis:
> > > > I think that the IDE doesn't recognize that there is text between[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > > opening and closing control tags. There for, as far as the IDE is
> > > > concerned, in your example, all you have in your html is
> > > > This is some text before And this is my text after the Hyperlink
> > > > (there are two spaces between "before" and "After")
> > > >
> > > > And since, if you have two spaces in a row in HTML, the second is[/color]
> > ignored,[color=darkred]
> > > > the IDE tries to be slick and remove one of them for you. I'm not[/color][/color]
> sure[color=green]
> > if[color=darkred]
> > > > this would count as a "bug"... but it is surely something that they[/color]
> > ought[color=darkred]
> > > to
> > > > work on...
> > > >
> > > > What do you think of the theory?
> > > >
> > > > -Cliff
> > > >
> > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > news:e9OS0rVqDHA.2188@TK2MSFTNGP11.phx.gbl...
> > > > > Cliff,
> > > > >
> > > > > This situation is strange...
> > > > >
> > > > > If I go to HTML mode and enter the space in the control tag then[/color]
> > switch[color=darkred]
> > > to
> > > > > design mode the space dies not appear. However, when I switch back[/color][/color]
> to[color=green][color=darkred]
> > > HTML
> > > > > mode the space is retained.
> > > > >
> > > > > When compiled and run the tag shows the space.
> > > > >
> > > > > The problem with this approach is the style for hyperlinks (ie
> > > underline)
> > > > > applies to the space character as well.
> > > > >
> > > > >
> > > > > Regards
> > > > > Brian W
> > > > >
> > > > >
> > > > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > > > news:uHb$wRVqDHA.1676@TK2MSFTNGP09.phx.gbl...
> > > > > > That could be true...
> > > > > > I'm curious: If you place the space within the control tage,[/color][/color][/color]
will[color=blue][color=green]
> > it[color=darkred]
> > > be
> > > > > > removed?
> > > > > > Such as:
> > > > > > This is some text before <asp:hyperlink id="hl1" runat="server[/color][/color][/color]
"[color=blue][color=green][color=darkred]
> > > > > > navigateurl="http://www.microsoft.com">This is my link
> > > > </asp:hyperlink>And
> > > > > > this is my text after the Hyperlink
> > > > > >
> > > > > > I know this isn't necessarily a valid solution, but I'm curious[/color][/color][/color]
as[color=blue][color=green]
> > to[color=darkred]
> > > if
> > > > > the
> > > > > > space will be retained.
> > > > > >
> > > > > > -Cliff
> > > > > >
> > > > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
> > > > > > news:e624qDVqDHA.2188@TK2MSFTNGP11.phx.gbl...
> > > > > > > Thanks for your comments, Cliff.
> > > > > > >
> > > > > > > No, I said "...not ALWAYS an expectable workaround"
> > > > > > >
> > > > > > > It has nothing to do with the number of keystrokes to type[/color]
> > "&nbsp;"[color=darkred]
> > > > The
> > > > > > > difference between having a non-breaking space and not having[/color][/color]
> one[color=green][color=darkred]
> > > > could
> > > > > in
> > > > > > > some cases make a difference between your layout looking good[/color][/color]
> and[color=green][color=darkred]
> > > > > looking
> > > > > > > like crap ;-)
> > > > > > >
> > > > > > > Regards
> > > > > > > Brian W
> > > > > > >
> > > > > > >
> > > > > > > "Cliff Harris" <hersh@myrealbox.com> wrote in message
> > > > > > > news:%23ZY7z6UqDHA.2676@TK2MSFTNGP11.phx.gbl...
> > > > > > > > I have noticed the same problem... it is, at times,[/color]
> > inconvenient.[color=darkred]
> > > > > > > > However, I do not understand why inserting an &nbsp;[/color][/color][/color]
character[color=blue][color=green][color=darkred]
> > > > > > > > isn't an acceptable workaround? Just a few more keystrokes[/color][/color][/color]
:)[color=blue][color=green][color=darkred]
> > > > > > > >
> > > > > > > >
> > > > > > > > "Brian W" <brianw@gold_death_2_spam_rush.com> wrote in[/color][/color][/color]
message[color=blue][color=green][color=darkred]
> > > > > > > > news:O1WnbVUqDHA.1488@TK2MSFTNGP12.phx.gbl...
> > > > > > > > > Yet another editor problem
> > > > > > > > >
> > > > > > > > > To reproduce do the following
> > > > > > > > >
> > > > > > > > > 1) Open a Webform and switch to HTML edit mode
> > > > > > > > >
> > > > > > > > > 2) Enter the Following (include spaces)
> > > > > > > > > This is some text before <asp:hyperlink id="hl1"
> > > > > runat="server
> > > > > > "
> > > > > > > > > navigateurl="http://www.microsoft.com">This is my
> > > > > link</asp:hyperlink>
> > > > > > > And
> > > > > > > > > this is my text after the Hyperlink
> > > > > > > > >
> > > > > > > > > 3) Switch back to design mode.
> > > > > > > > > Notice, the space has been remove between the[/color]
> > hyperlink[color=darkred]
> > > > and
> > > > > > the
> > > > > > > > word
> > > > > > > > > "And"
> > > > > > > > >
> > > > > > > > > 4) Now, in design mode type a space character between the
> > > > hyperlink
> > > > > > and
> > > > > > > > the
> > > > > > > > > word "And"
> > > > > > > > >
> > > > > > > > > 5) Switch back to HTML edit mode and notice the IDE[/color][/color][/color]
placed[color=blue]
> a[color=green][color=darkred]
> > > > &nbsp;
> > > > > > > where
> > > > > > > > > you typed the space character.
> > > > > > > > > This is not always an acceptable workaround.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > To prove this only happens with the ASP.NET control,[/color][/color][/color]
perform[color=blue][color=green]
> > the[color=darkred]
> > > > > > > following
> > > > > > > > > space
> > > > > > > > >
> > > > > > > > > 1) Open the Webform in HTML edit mode again
> > > > > > > > >
> > > > > > > > > 2) Enter the following (include spaces)
> > > > > > > > > This is some text before <a
> > > > > > href="http://www.microsoft.com">This
> > > > > > > > is
> > > > > > > > > my HTML hyperlink</a> And this text appears after the HTML
> > > > > hyperlink.
> > > > > > > > >
> > > > > > > > > 3) Switch to design mode
> > > > > > > > > Notice the space between the hyperlink and the[/color][/color][/color]
word[color=blue][color=green][color=darkred]
> > > "And"
> > > > is
> > > > > > > > > retained, and no &nbsp; characters are inserted.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Any recommendations?
> > > > > > > > >
> > > > > > > > > TIA
> > > > > > > > >
> > > > > > > > > Regards
> > > > > > > > > Brian W
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >[/color]
> >[/color]
>
>
>[/color]

Closed Thread