
我目前正在开发一个在数据层中使用MS sqlServer数据库的asp.net网站.
而且我在想我有什么选择来获得移动版本(最重要的是支持BlackBerry和iPhone以及希望每个移动设备!),当在黑莓上使用时,我希望能够让它在BB的背景下运行.
我在考虑使用asp.net移动控件,但projects page似乎是一个死的/未更新的框架,并不确定是否只支持windows手机或什么!
编辑
谢谢你的问题,但他们都只是从一个相应的问题来解决我的问题.我的意思是这将如何让我使用BlackBerry Appliction选项,例如让我的网站在设备后台运行或向我的用户发送通知!
This question介绍了如何根据设备类型更改视图,
如果您使用WebForms,则可以根据浏览器更改MasterPage,从而使您能够更轻松地切换到移动版本:
protected voID Page_PreInit(object sender,EventArgs e){ if (Request.browser.IsMobileDevice) MasterPagefile = "~/Mobile.Master";} 或者使用Global.asax完全重定向移动请求:
voID Session_Start(object sender,EventArgs e){ // Redirect mobile users to the mobile home page httpRequest httpRequest = httpContext.Current.Request; if (httpRequest.browser.IsMobileDevice) { string path = httpRequest.Url.PathAndquery; bool isOnMobilePage = path.StartsWith("/Mobile/",StringComparison.OrdinalignoreCase); if (!isOnMobilePage) { string redirectTo = "~/Mobile/"; // Could also add special logic to redirect from certain // recognized pages to the mobile equivalents of those // pages (where they exist). For example,// if (httpContext.Current.Handler is UserRegistration) // redirectTo = "~/Mobile/Register.aspx"; httpContext.Current.Response.Redirect(redirectTo); } }} 无论哪种方式阅读这篇文章:http://www.asp.net/learn/whitepapers/add-mobile-pages-to-your-aspnet-web-forms-mvc-application
总结以上是内存溢出为你收集整理的c# – asp.net开发人员开发其现有网站的移动版本的最佳(简单和高效)解决方案全部内容,希望文章能够帮你解决c# – asp.net开发人员开发其现有网站的移动版本的最佳(简单和高效)解决方案所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)