469,568 Members | 1,466 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

Html 4.01 strict instead of xhtml?

Can I stop asp.net from applying self closing tags? I am trying to generate
an html 4.01 strict page rather than an xhtml page and the w3 validator is
unhappy about asp.net automatically translating this:

<link rel="stylesheet" href="SkinStyle.aspx?SkinName=Test" type="text/css">

to this:

<link rel="stylesheet" href="SkinStyle.aspx?SkinName=Test" type="text/css"
/>
Aug 7 '07 #1
4 1577
Hi Andy,

Regarding on the ASP.NET/VS IDE html formatting question you mentioned
they're actually controlled by the HTML Designer's formatting and
validation setting. You can configure them through the following approaches:

For the automatically close tag behavior, you can set it through the below
steps:

**open "tools ---options" menu,

** in the opened dialog, choose the following path in left view:

Text Editor-->HTML-->Format-->

and you'll find the "Auto Insert close Tag" check option

for the design-time validation(against html), you can also find the
following setting:

Text Editor-->HTML-->Validation ---"Target:"

you can choose "HTML 4.01" as your ASPX page's target validation
schema(instead of xhtml 1.0)

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Aug 7 '07 #2
Steven Cheng[MSFT] wrote:
Hi Andy,

Regarding on the ASP.NET/VS IDE html formatting question you mentioned
they're actually controlled by the HTML Designer's formatting and
validation setting. You can configure them through the following
approaches:

For the automatically close tag behavior, you can set it through the
below steps:

**open "tools ---options" menu,

** in the opened dialog, choose the following path in left view:

Text Editor-->HTML-->Format-->

and you'll find the "Auto Insert close Tag" check option
Hi, thanks for your help! I just tried this but it didn't make a difference.
The tag doesn't have self closing tags in the designer, only in the
outputted html.
Aug 7 '07 #3
Steven Cheng[MSFT] wrote:
So far I think one way to overcome this behavior would be manually
customize the ASP.NET page's response output through a Response Filter
stream. You can attach a Filter for each Page's Response and modify
the response content. Here is a web article demonstrate using
response Filter to customize(format) page output:

http://aspnetresources.com/articles/HttpFilters.aspx
Producing XHTML-Compliant Pages With Response Filters

For your scenario, you may use it to change all the "/>" close tag to
">".
Perfect, thank you!
Aug 8 '07 #4
You're welcome :)

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Aug 8 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

50 posts views Thread by Christopher Benson-Manica | last post: by
4 posts views Thread by Arthur Dent | last post: by
29 posts views Thread by VK | last post: by
2 posts views Thread by PapaRandy | last post: by
21 posts views Thread by =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.