web developer tips (13):用ASP.NET Ajax获取浏览器的agent
2009-06-28 – 18:57
原文地址:How to get the browser agent using ASP.NET Ajax
当编写一个web应用的时候,很多时候,针对不同的浏览器做不同的页面请求,ASP.NET Ajax 有个简单的办法通过 Sys.Browser来获取浏览器对象。
http://www.watch-life.net/visual-studio/get-the-browser-agent-using-asp-net-ajax.html
例如,想针对Opera浏览器做一些不同的页面请求,下面的代码块显示可以如何:
<script language="javascript" type="text/javascript">
function DoSomething() {
if(Sys.Browser.agent === Sys.Browser.Opera)
{
// opera specific code here
}......[阅读全文]
分类: Visual Studio | 没有评论 »

