是否可以在编译之前将 ASP.NET 页面验证为有效的 HTML

发布于 2024-07-17 09:15:46 字数 208 浏览 5 评论 0原文

根据我的问题此处,我运行了建议的 Tidy 程序回来时出现了一大堆关于该工具无法识别 ASP 标签的错误。 是否可以使用工具在通过浏览器编译/交付之前验证 ASP.NET 页面?

Following my question here I run the suggested Tidy Program which came back with a whole load of errors regarding the tool not recognising ASP tags. Is it possible for a tool to validate ASP.NET pages before compile/delivery via a browser?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

吹泡泡o 2024-07-24 09:15:46

如果您使用 VS,那么您的页面将在您键入时进行评估,不匹配的标签等会突出显示。 除了确保您已正确输入 HTML 之外,我不确定您要解决什么问题。

我解决此类问题的方法是从源头解决问题,而不是中途修补。

If you are using VS then your pages are being evaluated as you type them, mismatched tags, etc are highlighted. Beyond making sure that you have entered the HTML correctly I'm not sure what problem you are looking to solve.

My approach to any problem of this type is to solve it at source rather than patching mid-way.

吃→可爱长大的 2024-07-24 09:15:46

您可以通过覆盖适当的渲染方法来执行自己的验证。

you could potentially perform your own validation by overriding the appropriate render methods.

欲拥i 2024-07-24 09:15:46

您可以使用 HttpModule 验证呈现的 ASP.NET(对于 IIS7 甚至静态)页面。 有关完整的示例,请检查:XHTML Validator For All

如果您记录验证错误,您可以稍后直接解决它们(在源代码级别)。

You can validate the rendered ASP.NET (and with IIS7 even static) pages using a HttpModule. For a complete example check: XHTML Validator For All.

If you log the validation errors, you can later address them directly (at the source level).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文