locked
"Mobilize" an existing asp.net application. RRS feed

  • Question

  • User1095705564 posted
    I have a live business directory application written with ASP.net at www.mass.biz. I wish to add mobile device support using ASP.net mobile controls. With this being my first mobile ASP.net project, I decided to ask for input on best practices for adding mobile support to an existing app. I currently have a default.aspx page which renders the front page. I figured that I need to add mobile versions of this and all aspx pages such as default_mobile.aspx. However, what code forwards the mobile device from default.aspx to default_mobile.aspx? Any other insights in doing this would be appreciated too. Thanks, Gary
    Saturday, May 29, 2004 10:50 AM

All replies

  • User-1804824805 posted
    Here is a link to an MSDN article on detecting Pocket IE. The same sorts of techniques can be used for other mobile devices.
    Sunday, May 30, 2004 11:43 AM
  • User1095705564 posted
    I found the answer myself in MSDN... I'm posting it in case someone else out there has the same question. http://msdn.microsoft.com/library/en-us/mwsdk/html/mwconredirectingtomobilewebapplication.asp
    Sunday, May 30, 2004 11:14 PM
  • User-1404012336 posted
    If you Redirect to a Mobile Web Application like this http://msdn.microsoft.com/library/en-us/mwsdk/html/mwconredirectingtomobilewebapplication.asp the users with a desktop Opera browser www.opera.com (In fact this reply was written by me in Opera 7.5) will be redirected to MobileDefault.aspx - mobile web site instead of DesktopDefault.aspx, since ASP.NET Mobile Controls detect opera as mobile browser (There are opera browsers for mobile devices too), so I advice you to add this <%@ Page Language="C#" %> <script runat="server"> public void Page_Load(Object sender, EventArgs e) { if(Request.Browser.Browser.Equals("Opera")) { Response.Redirect("DesktopDefault.aspx"); } else if(Request.Browser["IsMobileDevice"] == "true" ) { Response.Redirect("MobileDefault.aspx"); } else { Response.Redirect("DesktopDefault.aspx"); } } </script> If the user with an Opera browser on a mobile device will hit your desktop web site it is OK, since Opera uses SSR (Small-Screen Rendering) - read more at http://www.opera.com/products/smartphone/smallscreen/
    Tuesday, June 1, 2004 4:47 PM