针对 ASP.NET 应用程序优化 ASP.NET 应用程序 iPhone 和 Android 浏览器
我有一个 ASP.NET(不是 MVC)应用程序。
我想创建一个针对 iPhone 和 Android 上的浏览器进行优化的版本。
一些问题
- 访问网站时是否可以检测 iPhone/Android
- 是否有为这些设备开发 ASP.NET 的陷阱/技巧?
I have an ASP.NET (not MVC) application.
I would like to create a version that is optimised for browsers on the IPhone and on Android.
Some questions
- Is it possible to detect IPhone/Android when the site is accessed
- Are there any gotchas/tips for developing ASP.NET for these devices.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们结合使用 .net webforms 和 jQuery mobile。
对于我们的视图状态,它已经被很好地中和了,所以只有少量的东西会被传输到设备上。
请记住,大约有 3 种不同的移动 API。每一种都有各自的缺点。您可能想逐一进行调查。
此外,我们采取的方法是,移动网站是一个与我们的标准网站完全不同的网站。当用户进来时,我们会进行一些浏览器嗅探,如果与链接匹配,我们就会将他们推送到移动设备,如果他们愿意的话,可以返回到完整的链接。
We're using a combination of .net webforms and jQuery mobile.
For our viewstate, it's been pretty well neutered already so only minor stuff is going down to the device.
Bear in mind that there are around 3 different mobile api's. Each of which has their own drawbacks. You might want to investigate each.
Also, we took the approach that the mobile site was a completely different website than our standard one. When the user comes in, we do some browser sniffing and push them to mobile if it matches with a link to move back to the full one if they want.
网络表单不适合移动设备,它会因为视图状态而生成大页面。而且你无法控制渲染(.net4 中有更多)。
您可以使用诸如 WURFL 之类的功能数据库来检测设备(我推荐 51°s) o 也许使用类似 http://detectmobilebrowser.com/
我不知道什么样的网络应用程序,但你可以制作一个新的应用程序,也许使用 MVC。请查看此资源。
Webforms aren´t good for mobile, it generates big pages because viewstate. And you can´t control rendering (some more in .net4).
You can detect device using a db of capabilities like WURFL (I recommend 51degrees) o maybe using some like http://detectmobilebrowser.com/
I don´t know what kind of webapp but you could make a new app, maybe using MVC. Please look this resource.