W3C验证 [英] W3C validation

查看:108
本文介绍了W3C验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我一直试图获得一个ASP.NET网站我正在研究验证为HTML 4.01

Transitional但是我遇到了一些问题 - 实际上只有在页面验证之前剩下的
...


1:ID标签上服务器端控件以不允许使用的字符开头

(在本例中为''_''),例如标签:

< span id =" _ctl0_labDate" ;>


2:回发按钮(类型为提交的输入)获取一个语言参数

定义,在过渡时不允许:

< input name =" _ctl0:btnAddPreDefined" value =" L?gg until onclick =" if

(typeof(Page_ClientValidate)==''function'')Page_ClientValidate();

language =" javascript" ID = QUOT; _ctl0_btnAddPreDefined" type =" submit">

Hi,

I''ve been trying to get a ASP.NET site I''m working on validated as HTML 4.01
Transitional but I''ve run into a couple of problems - actually the only ones
left before the page is validated...

1: the ID tags on serverside controls start with a char which is not allowed
(in this case ''_''), example is a Label:
<span id="_ctl0_labDate">

2: postback buttons (inputs with type submit) gets a language parameter
defined which is not allowed in transitional:
<input name="_ctl0:btnAddPreDefined" value="L?gg till" onclick="if
(typeof(Page_ClientValidate) == ''function'') Page_ClientValidate(); "
language="javascript" id="_ctl0_btnAddPreDefined" type="submit">

推荐答案

忘记了问题:)


任何人都知道如何修复我描述的问题?


提前致谢

// Fredrik


" Fredrik Elestedt" <无**** @ nospam.now>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
Forgot the question :)

Anyone know how to fix the problems I described?

Thanks in advance
// Fredrik

"Fredrik Elestedt" <no****@nospam.now> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...


我一直试图获得一个ASP.NET网站我正在研究验证为HTML
4.01 Transitional但我遇到了几个问题 - 实际上是
只有在页面验证之前剩下的...

1:服务器端控件上的ID标签以一个不允许的char开头(在这种情况下''_ ''),示例是一个标签:
< span id =" _ctl0_labDate">

2:回发按钮(输入类型为submit)获取语言参数
过渡时不允许定义:
< input name =" _ctl0:btnAddPreDefined" value =" L?gg until onclick =" if
(typeof(Page_ClientValidate)==''function'')Page_ClientValidate();
language =" javascript" ID = QUOT; _ctl0_btnAddPreDefined" type =" submit">
Hi,

I''ve been trying to get a ASP.NET site I''m working on validated as HTML
4.01 Transitional but I''ve run into a couple of problems - actually the
only ones left before the page is validated...

1: the ID tags on serverside controls start with a char which is not
allowed (in this case ''_''), example is a Label:
<span id="_ctl0_labDate">

2: postback buttons (inputs with type submit) gets a language parameter
defined which is not allowed in transitional:
<input name="_ctl0:btnAddPreDefined" value="L?gg till" onclick="if
(typeof(Page_ClientValidate) == ''function'') Page_ClientValidate(); "
language="javascript" id="_ctl0_btnAddPreDefined" type="submit">



>我一直在尝试获得一个ASP.NET网站我正在验证为HTML

4.01

为什么?


你的网页在你测试的浏览器中的表现是否符合你的要求?


如果是这样,那有什么问题?如果没有,为什么不修理它们?


Bob Lehmann


Fredrik Elestedt <无**** @ nospam.now>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
> I''ve been trying to get a ASP.NET site I''m working on validated as HTML
4.01
Why?

Do your pages behave the way you would like them to in the browsers you
tested?

If so, what''s the problem? If not, why don''t you fix them?

Bob Lehmann

"Fredrik Elestedt" <no****@nospam.now> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...


我一直在努力获得一个ASP.NET网站我正在研究验证为HTML
4.01 Transitional但我遇到了几个问题 - 实际上是在页面验证之前只剩下
...

1:服务器端控件上的ID标签以一个不允许
的char开头(在这种情况下''_ ''),示例是一个标签:
< span id =" _ctl0_labDate">

2:回发按钮(输入类型为submit)获取语言参数
过渡时不允许定义:
< input name =" _ctl0:btnAddPreDefined" value =" L?gg until onclick =" if
(typeof(Page_ClientValidate)==''function'')Page_ClientValidate();
language =" javascript" ID = QUOT; _ctl0_btnAddPreDefined" type =" submit">
Hi,

I''ve been trying to get a ASP.NET site I''m working on validated as HTML 4.01 Transitional but I''ve run into a couple of problems - actually the only ones left before the page is validated...

1: the ID tags on serverside controls start with a char which is not allowed (in this case ''_''), example is a Label:
<span id="_ctl0_labDate">

2: postback buttons (inputs with type submit) gets a language parameter
defined which is not allowed in transitional:
<input name="_ctl0:btnAddPreDefined" value="L?gg till" onclick="if
(typeof(Page_ClientValidate) == ''function'') Page_ClientValidate(); "
language="javascript" id="_ctl0_btnAddPreDefined" type="submit">



Hello Fredrik,
Hello Fredrik,
1:ID服务器端控件上的标签以不允许的字符开头
(在本例中为''_''),例如标签:
< span id =" _ctl0_labDate"> ;


您可以通过向包含控件提供ID而不是省略它来避免这种情况。


< form runat =" server" / >

< asp:Label ID =" labDate" Runat =" server" />

< / form>


生成您所看到的内容 - 请尝试:

< form ID =" myForm" runat =" server" />

< asp:Label ID =" labDate" Runat =" server" />

< / form>


这会生成myForm_labDate作为标签的ID。

2:回发按钮(类型为提交的输入)获得定义的语言
参数,这在过渡时是不允许的:
< ; input name =" _ctl0:btnAddPreDefined" value =" L?gg until onclick =" if
(typeof(Page_ClientValidate)==''function'')Page_ClientValidate();
language =" javascript" ID = QUOT; _ctl0_btnAddPreDefined" type =" submit">
1: the ID tags on serverside controls start with a char which is not
allowed
(in this case ''_''), example is a Label:
<span id="_ctl0_labDate">
You can avoid this by giving the containing control an ID instead of omitting it.

<form runat="server"/>
<asp:Label ID="labDate" Runat="server"/>
</form>

Generates what you are seeing - instead try:

<form ID="myForm" runat="server"/>
<asp:Label ID="labDate" Runat="server"/>
</form>

this generates "myForm_labDate" as an ID for the label.
2: postback buttons (inputs with type submit) gets a language
parameter
defined which is not allowed in transitional:
<input name="_ctl0:btnAddPreDefined" value="L?gg till" onclick="if
(typeof(Page_ClientValidate) == ''function'') Page_ClientValidate(); "
language="javascript" id="_ctl0_btnAddPreDefined" type="submit">




我从未注意到这一点?但解决方案可能是将页面过滤器应用于您的页面,对输出进行后处理以确保有效性。它不是最漂亮的解决方案,但对于.NET 1.1,我认为它是最好的。关于这个主题的一篇很好的文章,尽管是XHTML输出: http://www.aspnetresources .com / artic ... tpFilters.aspx


这篇关于W3C验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆