473,788 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I stop Visual Studio spoiling my valid XHTML ?

I'm using Visual Studio to build ASP.Net pages and I'm trying to be
standards compliant by using XHTML.

In my page I create valid XHTML such as:
<ul>
<li>first list item</li>
<li>second list item<br />
includes a line break</li>
</ul>

When I switch between design and HTML modes Visual Studio screws up my XHTML
to turn it in to:
<ul>
<li>
first list item
<li>
second list item<br>
includes a line break
</li>
</ul>
Any <LI> except the last is missing its closing tag.
Any 'self closing' tag such as IMG, BR, HR is stripped of it closure.

I've searched all over but can't find any instruction or setting that might
control this kind of thing.

The obvious place would be the !DOCTYPE setting, but manually inserting the
correct DOCTYPE and a URL for the DTD doesn't help.

Less obvious would be the 'target browser' setting but none of the options
offered geerates XHTML.

So. Can anyone tell me how to set up VS2003 (EA) so that I can have the IDE
build ASP.Net pages that are
valid XHTML instead of HTML?

Brian Lowe
---------@
Nov 19 '05 #1
9 1609
In VS go to Tools - Options - HTML/XML - Format
At the top top you have "Apply Automatic Formatting" section.
Uncheck the tow checkboxes, so the VS doesn't format your HTML.

Hope that helps!
Regards,
Kostadin Kostov

"Brian Lowe" wrote:
I'm using Visual Studio to build ASP.Net pages and I'm trying to be
standards compliant by using XHTML.

In my page I create valid XHTML such as:
<ul>
<li>first list item</li>
<li>second list item<br />
includes a line break</li>
</ul>

When I switch between design and HTML modes Visual Studio screws up my XHTML
to turn it in to:
<ul>
<li>
first list item
<li>
second list item<br>
includes a line break
</li>
</ul>
Any <LI> except the last is missing its closing tag.
Any 'self closing' tag such as IMG, BR, HR is stripped of it closure.

I've searched all over but can't find any instruction or setting that might
control this kind of thing.

The obvious place would be the !DOCTYPE setting, but manually inserting the
correct DOCTYPE and a URL for the DTD doesn't help.

Less obvious would be the 'target browser' setting but none of the options
offered geerates XHTML.

So. Can anyone tell me how to set up VS2003 (EA) so that I can have the IDE
build ASP.Net pages that are
valid XHTML instead of HTML?

Brian Lowe
---------@

Nov 19 '05 #2
In VS go to Tools - Options - HTML/XML - Format
At the top top you have "Apply Automatic Formatting" section.
Uncheck the tow checkboxes, so the VS doesn't format your HTML.

Hope that helps!
Regards,
Kostadin Kostov

"Brian Lowe" wrote:
I'm using Visual Studio to build ASP.Net pages and I'm trying to be
standards compliant by using XHTML.

In my page I create valid XHTML such as:
<ul>
<li>first list item</li>
<li>second list item<br />
includes a line break</li>
</ul>

When I switch between design and HTML modes Visual Studio screws up my XHTML
to turn it in to:
<ul>
<li>
first list item
<li>
second list item<br>
includes a line break
</li>
</ul>
Any <LI> except the last is missing its closing tag.
Any 'self closing' tag such as IMG, BR, HR is stripped of it closure.

I've searched all over but can't find any instruction or setting that might
control this kind of thing.

The obvious place would be the !DOCTYPE setting, but manually inserting the
correct DOCTYPE and a URL for the DTD doesn't help.

Less obvious would be the 'target browser' setting but none of the options
offered geerates XHTML.

So. Can anyone tell me how to set up VS2003 (EA) so that I can have the IDE
build ASP.Net pages that are
valid XHTML instead of HTML?

Brian Lowe
---------@

Nov 19 '05 #3
Thanks.

This is a good answer to my question. It does exactly what I asked.

My question should have been "How can I get Visual Studio to tidy up my
XHTML without making it invalid?"

I'd like to be able to have VS reformat the XHTML in the same way that it
does HTML, but for it to retain the necessary closures on 'self closing'
elements like <br /> and <img /> and on tags like <li> where the </li> is
optional in HTML but mandatory in XHTML.

At least until I find something to do that I can just stop VS reformatting
anything.


"Kostadin Kostov" <Ko************ @discussions.mi crosoft.com> wrote in
message news:FD******** *************** ***********@mic rosoft.com...
In VS go to Tools - Options - HTML/XML - Format
At the top top you have "Apply Automatic Formatting" section.
Uncheck the tow checkboxes, so the VS doesn't format your HTML.

Hope that helps!
Regards,
Kostadin Kostov

"Brian Lowe" wrote:
I'm using Visual Studio to build ASP.Net pages and I'm trying to be
standards compliant by using XHTML.

In my page I create valid XHTML such as:
<ul>
<li>first list item</li>
<li>second list item<br />
includes a line break</li>
</ul>

When I switch between design and HTML modes Visual Studio screws up my
XHTML
to turn it in to:
<ul>
<li>
first list item
<li>
second list item<br>
includes a line break
</li>
</ul>
Any <LI> except the last is missing its closing tag.
Any 'self closing' tag such as IMG, BR, HR is stripped of it closure.

I've searched all over but can't find any instruction or setting that
might
control this kind of thing.

The obvious place would be the !DOCTYPE setting, but manually inserting
the
correct DOCTYPE and a URL for the DTD doesn't help.

Less obvious would be the 'target browser' setting but none of the
options
offered geerates XHTML.

So. Can anyone tell me how to set up VS2003 (EA) so that I can have the
IDE
build ASP.Net pages that are
valid XHTML instead of HTML?

Brian Lowe
---------@

Nov 19 '05 #4
Thanks.

This is a good answer to my question. It does exactly what I asked.

My question should have been "How can I get Visual Studio to tidy up my
XHTML without making it invalid?"

I'd like to be able to have VS reformat the XHTML in the same way that it
does HTML, but for it to retain the necessary closures on 'self closing'
elements like <br /> and <img /> and on tags like <li> where the </li> is
optional in HTML but mandatory in XHTML.

At least until I find something to do that I can just stop VS reformatting
anything.


"Kostadin Kostov" <Ko************ @discussions.mi crosoft.com> wrote in
message news:FD******** *************** ***********@mic rosoft.com...
In VS go to Tools - Options - HTML/XML - Format
At the top top you have "Apply Automatic Formatting" section.
Uncheck the tow checkboxes, so the VS doesn't format your HTML.

Hope that helps!
Regards,
Kostadin Kostov

"Brian Lowe" wrote:
I'm using Visual Studio to build ASP.Net pages and I'm trying to be
standards compliant by using XHTML.

In my page I create valid XHTML such as:
<ul>
<li>first list item</li>
<li>second list item<br />
includes a line break</li>
</ul>

When I switch between design and HTML modes Visual Studio screws up my
XHTML
to turn it in to:
<ul>
<li>
first list item
<li>
second list item<br>
includes a line break
</li>
</ul>
Any <LI> except the last is missing its closing tag.
Any 'self closing' tag such as IMG, BR, HR is stripped of it closure.

I've searched all over but can't find any instruction or setting that
might
control this kind of thing.

The obvious place would be the !DOCTYPE setting, but manually inserting
the
correct DOCTYPE and a URL for the DTD doesn't help.

Less obvious would be the 'target browser' setting but none of the
options
offered geerates XHTML.

So. Can anyone tell me how to set up VS2003 (EA) so that I can have the
IDE
build ASP.Net pages that are
valid XHTML instead of HTML?

Brian Lowe
---------@

Nov 19 '05 #5
Unfortunately, this feature...it really is a bug..did not ship with vs2003.
It will always mess with your markup no matter what you do. They plan on
resolving this in the next release of Visual Studio

"Brian Lowe" <br********@ntl world.com> wrote in message
news:en******** ******@TK2MSFTN GP15.phx.gbl...
Thanks.

This is a good answer to my question. It does exactly what I asked.

My question should have been "How can I get Visual Studio to tidy up my
XHTML without making it invalid?"

I'd like to be able to have VS reformat the XHTML in the same way that it
does HTML, but for it to retain the necessary closures on 'self closing'
elements like <br /> and <img /> and on tags like <li> where the </li> is
optional in HTML but mandatory in XHTML.

At least until I find something to do that I can just stop VS reformatting
anything.


"Kostadin Kostov" <Ko************ @discussions.mi crosoft.com> wrote in
message news:FD******** *************** ***********@mic rosoft.com...
In VS go to Tools - Options - HTML/XML - Format
At the top top you have "Apply Automatic Formatting" section.
Uncheck the tow checkboxes, so the VS doesn't format your HTML.

Hope that helps!
Regards,
Kostadin Kostov

"Brian Lowe" wrote:
I'm using Visual Studio to build ASP.Net pages and I'm trying to be
standards compliant by using XHTML.

In my page I create valid XHTML such as:
<ul>
<li>first list item</li>
<li>second list item<br />
includes a line break</li>
</ul>

When I switch between design and HTML modes Visual Studio screws up my
XHTML
to turn it in to:
<ul>
<li>
first list item
<li>
second list item<br>
includes a line break
</li>
</ul>
Any <LI> except the last is missing its closing tag.
Any 'self closing' tag such as IMG, BR, HR is stripped of it closure.

I've searched all over but can't find any instruction or setting that
might
control this kind of thing.

The obvious place would be the !DOCTYPE setting, but manually inserting
the
correct DOCTYPE and a URL for the DTD doesn't help.

Less obvious would be the 'target browser' setting but none of the
options
offered geerates XHTML.

So. Can anyone tell me how to set up VS2003 (EA) so that I can have the
IDE
build ASP.Net pages that are
valid XHTML instead of HTML?

Brian Lowe
---------@


Nov 19 '05 #6
Unfortunately, this feature...it really is a bug..did not ship with vs2003.
It will always mess with your markup no matter what you do. They plan on
resolving this in the next release of Visual Studio

"Brian Lowe" <br********@ntl world.com> wrote in message
news:en******** ******@TK2MSFTN GP15.phx.gbl...
Thanks.

This is a good answer to my question. It does exactly what I asked.

My question should have been "How can I get Visual Studio to tidy up my
XHTML without making it invalid?"

I'd like to be able to have VS reformat the XHTML in the same way that it
does HTML, but for it to retain the necessary closures on 'self closing'
elements like <br /> and <img /> and on tags like <li> where the </li> is
optional in HTML but mandatory in XHTML.

At least until I find something to do that I can just stop VS reformatting
anything.


"Kostadin Kostov" <Ko************ @discussions.mi crosoft.com> wrote in
message news:FD******** *************** ***********@mic rosoft.com...
In VS go to Tools - Options - HTML/XML - Format
At the top top you have "Apply Automatic Formatting" section.
Uncheck the tow checkboxes, so the VS doesn't format your HTML.

Hope that helps!
Regards,
Kostadin Kostov

"Brian Lowe" wrote:
I'm using Visual Studio to build ASP.Net pages and I'm trying to be
standards compliant by using XHTML.

In my page I create valid XHTML such as:
<ul>
<li>first list item</li>
<li>second list item<br />
includes a line break</li>
</ul>

When I switch between design and HTML modes Visual Studio screws up my
XHTML
to turn it in to:
<ul>
<li>
first list item
<li>
second list item<br>
includes a line break
</li>
</ul>
Any <LI> except the last is missing its closing tag.
Any 'self closing' tag such as IMG, BR, HR is stripped of it closure.

I've searched all over but can't find any instruction or setting that
might
control this kind of thing.

The obvious place would be the !DOCTYPE setting, but manually inserting
the
correct DOCTYPE and a URL for the DTD doesn't help.

Less obvious would be the 'target browser' setting but none of the
options
offered geerates XHTML.

So. Can anyone tell me how to set up VS2003 (EA) so that I can have the
IDE
build ASP.Net pages that are
valid XHTML instead of HTML?

Brian Lowe
---------@


Nov 19 '05 #7
If you know what you are doing enough to write xhtml on your own I recommend
just giving design view the boot. I haven't used design view in about 2
years now. Also, the doctype that visual studio sticks in there is invalid
and causes your page to render in quirks mode.
Nov 19 '05 #8

"Tampa.NET Koder" <an*******@micr osoft.com> wrote in message
news:ef******** ******@tk2msftn gp13.phx.gbl...
Unfortunately, this feature...it really is a bug..did not ship with
vs2003. It will always mess with your markup no matter what you do. They
plan on resolving this in the next release of Visual Studio


All that hype about it being extensible and being able to add your own
XSD/DTD to add your own intellisense etc, and yet the combined wisdom of
Microsoft isn't able to create the required custom extension that enables
XHTML in the IDE?

Roll on 2005 (Oh, 2005 is here, so where's VS2005?)

Brian Lowe
---------@
Nov 19 '05 #9
I guess design view isn't offering me much of a benefit anyway, so setting
it aside is the way to go.

Thanks also for the tip about the generated doctype.

Brian Lowe
---------@

"Scott Simons" <Scott.Simons.A t.MealMagic.Com .Remove.This> wrote in message
news:D2******** *************** ***********@mic rosoft.com...
If you know what you are doing enough to write xhtml on your own I
recommend
just giving design view the boot. I haven't used design view in about 2
years now. Also, the doctype that visual studio sticks in there is
invalid
and causes your page to render in quirks mode.

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
807
by: Brian Lowe | last post by:
I'm using Visual Studio to build ASP.Net pages and I'm trying to be standards compliant by using XHTML. In my page I create valid XHTML such as: <ul> <li>first list item</li> <li>second list item<br /> includes a line break</li> </ul>
4
1286
by: Alan Silver | last post by:
Hello, I have a site that produces 100% valid XHTML 1.0 Strict when viewed in a browser (IE, Firefox, etc). I just tried validating the site with an on-line validator, and got several errors. It seems that the framework is sending the validator down-level code, as it assumes that the validator is a down-level browser. Is there any way to stop this? At the moment, anyone checking it (which
1
2899
by: cnixuser | last post by:
Hello, I am having a problem that I believe is related to the way a stream reader object looks for a text file by default. What I am doing is using a StreamReader object to read the text of a text file which includes some html code to populate html formatted content as the text of an asp:label (<asp:label>). The reading of the text file itself goes just fine ;however, this only occurs when I use an absolute file path which will not work of...
1
1980
by: DeveloperQuest | last post by:
How do I make Xhtml 1.0 strict or Xhtml 1.1 strict appear in the Visual Studio 2005 dropdown? How do I add a Xhtml 1.0 strict to the dropdown in visual studio 2005? I have used the default selection XHTML 1.0 Transistional. I have added <xhtmlConformance mode="Strict" /> in the web.config.
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.