如何在ASP.NET中检测DOCTYPE(过渡或严格)服务器端? [英] How do you detect DOCTYPE (Transitional or Strict) server-side in ASP.NET?

查看:129
本文介绍了如何在ASP.NET中检测DOCTYPE(过渡或严格)服务器端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法可以从服务器端检测页面指定为哪个DOCTYPE.我在自定义WebControl中有一些HTML和CSS,根据页面的DOCTYPE呈现不同的外观.我可以检查Page属性还是Response属性吗?

I am wondering if there is a way to detect from the server-side which DOCTYPE the page is specified as. I have some HTML and CSS in a custom WebControl that renders differently depending on which DOCTYPE the page is. Is there a Page property or a Response property I could check?

推荐答案

为什么您的控件上没有可以设置消耗页面的枚举或布尔值(这不像doctype应该在页面之间更改) )?

Why don't you have an enum or a boolean on your control that the consuming pages can set (it's not like the doctype should be changing from page to page)?

这篇关于如何在ASP.NET中检测DOCTYPE(过渡或严格)服务器端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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