【发布时间】:2013-10-26 11:26:00
【问题描述】:
我正在寻找一种方法将 HttpContext.Current.Request.Browser.IsMobileDevice 设置为 true 以用于未受 MVC4 和 51degrees.mobi 检测的自定义移动设备,这也在应用程序中使用。
我在 Global.asax.cs 中试过这个:
protected void Application_PreRequestHandlerExecute(Object sender, EventArgs e)
{
HttpContext.Current.Request.Browser.IsMobileDevice = true;
}
但是我得到一个编译错误:
属性或索引器 'System.Web.Configuration.HttpCapabilitiesBase.IsMobileDevice' 不能 被分配给——它是只读的
使用 51degrees.mobi、jquery、jquery-ui 和 jquery-ui-mobile。
【问题讨论】:
标签: c# jquery asp.net asp.net-mvc-4 mobile