控制浏览器类型
答
How to: Detect Browser Types and Browser Capabilities in ASP.NET Web Pages
我不是在输出IE6肯定的,但你可以这样做:
if (browser.Browser == "IE" && browser.Type == "6"){
phMessage.visible = True;
}
答
这应该通过使用conditional comments接近。
<body>
....
<!--[if lte IE 6]>
<div class="bigAndBold">YOUR BROWSER SUCKS</div>
<![endif]-->
....
</body>
答
<%
var b = Request.UserAgent.ToString();
if (b.Contains("MSIE 6.0"))
{
Response.Write("IE 6!");
}
// Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) == IE 9
// Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 == FF6
%>
你所说的 “控制浏览器类型” 是什么意思?的 – Oded
可能重复[如何确定使用ASP.NET和C#服务器端的浏览器类型?(http://stackoverflow.com/questions/2311077/how-to-determine-browser-type-from-server-side-使用-ASP网-C) – onof
检查这个out..http://www.codeproject.com/KB/aspnet/WebBrowser.aspx – 2011-09-20 12:50:22