Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Typing Markup Tags Ending in />

Reply
Thread Tools

Typing Markup Tags Ending in />

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      12-30-2006
I often use self-closing tags (such as <br/>) when creating an ASP.NET
application. However, when I enter them in Visual Studio .NET 2005, it
automatically inserts a space before the />. In most cases this does not
bother me, but for tags such as <br/> that I usually do not use any
attributes with I prefer not to have the extra space. I there a way to
prevent Visual Studio .NET 2005 from inserting the extra space before the />
at the end of the tag? Thanks.
--
Nathan Sokalski

http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      12-30-2006
Is <br/> really non XHTML-compliant? Visual Studio .NET might try to create
<br /> instead, but it doesn't mark my tags with a warning or anything. I
didn't think getting rid of the space before the / was breaking the rules of
XHTML. Is it?
--
Nathan Sokalski

http://www.nathansokalski.com/

"Mark Rae" <> wrote in message
news:%23dKpND%...
> "Nathan Sokalski" <> wrote in message
> news:...
>
>> I there a way to prevent Visual Studio .NET 2005 from inserting the extra
>> space before the /> at the end of the tag?

>
> Do you *really* want your code to be non XHTML-compliant and non
> cross-browser compatible...?
> http://www.w3schools.com/xhtml/xhtml_howto.asp
>



 
Reply With Quote
 
 
 
 
Martin Milan
Guest
Posts: n/a
 
      12-30-2006
"Nathan Sokalski" <> wrote in
news::

> I often use self-closing tags (such as <br/>) when creating an ASP.NET
> application. However, when I enter them in Visual Studio .NET 2005, it
> automatically inserts a space before the />. In most cases this does
> not bother me, but for tags such as <br/> that I usually do not use
> any attributes with I prefer not to have the extra space. I there a
> way to prevent Visual Studio .NET 2005 from inserting the extra space
> before the /> at the end of the tag? Thanks.


You wouldn't want to do this. It is merely following the XHTML
standards.

Martin
 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      12-30-2006
"Nathan Sokalski" <> schrieb:
> Is <br/> really non XHTML-compliant?


No, it is valid XHTML.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
 
Jay B. Harlow
Guest
Posts: n/a
 
      12-30-2006
> You wouldn't want to do this. It is merely following the XHTML
> standards.

Umm...

According to the W3C Markup Validation Service http://validator.w3.org/ both
<br/> and <br /> compliant XHTML 1.1!

Remember the w3.org is the group that defines the standard.

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


"Martin Milan" <> wrote in message
news:Xns98A96F516743DI8spmido@194.117.143.37...
> "Nathan Sokalski" <> wrote in
> news::
>
>> I often use self-closing tags (such as <br/>) when creating an ASP.NET
>> application. However, when I enter them in Visual Studio .NET 2005, it
>> automatically inserts a space before the />. In most cases this does
>> not bother me, but for tags such as <br/> that I usually do not use
>> any attributes with I prefer not to have the extra space. I there a
>> way to prevent Visual Studio .NET 2005 from inserting the extra space
>> before the /> at the end of the tag? Thanks.

>
> You wouldn't want to do this. It is merely following the XHTML
> standards.
>
> Martin


 
Reply With Quote
 
Jay B. Harlow
Guest
Posts: n/a
 
      12-30-2006
> Do you *really* want your code to be non XHTML-compliant and non
> cross-browser compatible...?
> http://www.w3schools.com/xhtml/xhtml_howto.asp

Unfortunately w3shcools.com is *not* the authority on internet standards.

Remember that http://www.w3.org is the group that defines the standard. I
would rely on w3.org for the authority on internet standards. Then rely on
other groups, such as w3shcools.com, for quirks (pun intended) that specific
browsers exhibit.

According to the W3C Markup Validation Service http://validator.w3.org/ both
<br/> and <br /> are compliant XHTML 1.1!

In fact the XHTML 1.0 Recommendation uses <br/> (no space) in their
examples! (heading 4.6 Empty Elements)

http://www.w3.org/TR/xhtml1/

Further depending on how old the howto page is, it may be totally
immaterial! What percentage of users, of the OP's web site, actually use
Netscape. What percentage of their users, use a version of Netscape that
exhibits the problem.

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


"Mark Rae" <> wrote in message
news:%23dKpND%...
> "Nathan Sokalski" <> wrote in message
> news:...
>
>> I there a way to prevent Visual Studio .NET 2005 from inserting the extra
>> space before the /> at the end of the tag?

>
> Do you *really* want your code to be non XHTML-compliant and non
> cross-browser compatible...?
> http://www.w3schools.com/xhtml/xhtml_howto.asp
>


 
Reply With Quote
 
Jay B. Harlow
Guest
Posts: n/a
 
      12-30-2006
Nathan,
As Herfried suggests <br/> is valid XHTML.

I normally use the W3C Markup Validation Service http://validator.w3.org/ to
verify compliant XHTML.

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


"Nathan Sokalski" <> wrote in message
news:uvnvhg%...
> Is <br/> really non XHTML-compliant? Visual Studio .NET might try to
> create <br /> instead, but it doesn't mark my tags with a warning or
> anything. I didn't think getting rid of the space before the / was
> breaking the rules of XHTML. Is it?
> --
> Nathan Sokalski
>
> http://www.nathansokalski.com/
>
> "Mark Rae" <> wrote in message
> news:%23dKpND%...
>> "Nathan Sokalski" <> wrote in message
>> news:...
>>
>>> I there a way to prevent Visual Studio .NET 2005 from inserting the
>>> extra space before the /> at the end of the tag?

>>
>> Do you *really* want your code to be non XHTML-compliant and non
>> cross-browser compatible...?
>> http://www.w3schools.com/xhtml/xhtml_howto.asp
>>

>
>


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      12-30-2006
Jay,

"Jay B. Harlow" <> schrieb:
> I normally use the W3C Markup Validation Service http://validator.w3.org/
> to verify compliant XHTML.


I prefer Christoph Schneegans' validator because it provides more accurate
results (it validates against XML schemas):

XML Schema Validator
<URL:http://schneegans.de/sv/>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

 
Reply With Quote
 
Jay B. Harlow
Guest
Posts: n/a
 
      12-30-2006
Thanks for the link, I've saved a copy for future reference.

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


"Herfried K. Wagner [MVP]" <hirf-spam-me-> wrote in message
news:...
> Jay,
>
> "Jay B. Harlow" <> schrieb:
>> I normally use the W3C Markup Validation Service http://validator.w3.org/
>> to verify compliant XHTML.

>
> I prefer Christoph Schneegans' validator because it provides more accurate
> results (it validates against XML schemas):
>
> XML Schema Validator
> <URL:http://schneegans.de/sv/>
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Typing to Nullable (Of Date) vs typing to Date JimLad ASP .Net 0 01-26-2010 07:54 PM
Typing Markup Tags Ending in /> Nathan Sokalski ASP .Net 14 01-02-2007 02:11 PM
typing location changes when I am typing. Ed Computer Support 5 11-11-2006 12:51 AM
Static Typing Where Possible and Dynamic Typing When Needed vladare Ruby 0 07-11-2005 11:54 AM
Ending tags with /> Tim Johansson HTML 5 08-07-2004 12:35 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57