<p>I'm working on an ASP.NET website which targets desktop browsers. We want to enable an optional mobile view (e.g. <a href="http://m.sample.com" rel="nofollow noreferrer">http://m.sample.com</a>) which will offer a few simple pages which will be mostly text. There will be not need for AJAX or even Javascript, and there's no user input - it's really just tables of text with a few links to navigate between the pages.</p>

<p>What's the best way to set this up so it will work on Blackberry, Windows Mobile, and iPhone?</p>

<p>Should I be looking at <a href="http://www.asp.net/mobile/" rel="nofollow noreferrer">ASP.NET Mobile</a> support, or just rolling my own pages?</p>

<p><strong>UPDATE</strong>: This was for m.microsoftpdc.com. We went with the /Mobile subfolder approach, and used <a href="http://www.hanselman.com/blog/MakeYourWebsiteMobileAndIPhoneFriendlyAddHomeScreenIPhoneIconsAndAdjustTheViewPort.aspx" rel="nofollow noreferrer">Scott Hanselman's iPhone tips for viewport and other stuff</a>.</p>

[{'answer_id': 59432, 'author': 'GEOCHET', 'author_id': 5640, 'author_profile': 'https://Stackoverflow.com/users/5640', 'pm_score': 0, 'selected': False, 'text': "<p>I know from personal experience there really isn't much you need to do for the iPhone. I usually rather just browse your regular site with my iPhone. </p>\n\n<p>Just my two cents though.</p>\n"}, {'answer_id': 59439, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Different style sheets based on user agent will handle the "pretty". Are you using master pages? You could also set up different masters based on the device using device filters.</p>\n'}, {'answer_id': 59460, 'author': 'Dale Ragan', 'author_id': 1117, 'author_profile': 'https://Stackoverflow.com/users/1117', 'pm_score': 4, 'selected': True, 'text': '<p>I have done this in the past and the way I did it is by separating the pages by creating a directory for Desktop and creating a directory for Mobile.  This gives you better separation of the views, since in reality they are a lot different.  In ASP.NET Forms I used the <a href="http://msdn.microsoft.com/en-us/magazine/cc188690.aspx" rel="nofollow noreferrer">Model View Presenter</a> pattern a lot since it went with the way ASP.NET Forms functioned the best.  That way I could reuse some code between the two views.  Then in your index.aspx page for the site, you just parse the user-agent string of the request to figure out the browser and redirect accordingly.  So, for example a person with an iphone comes to your site, you parse the <a href="http://developer.apple.com/documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/chapter_3_section_3.html" rel="nofollow noreferrer">user-agent string</a> and figure out it is an iphone.  Then you redirect to m.sample.com which is pointing to Mobile/Index.aspx page.  Otherwise you redirect to Desktop/Index.aspx.</p>\n<p>I did the parsing of the user-agent string at the page level, but of course you could do this kind of logic in the HttpModule or HttpHandler level also.</p>\n<h2>Edit</h2>\n<p>I just rolled my own pages since we weren\'t targeting phones that have WML support.  That would be the only reason in my opinion to use the ASP.NET Mobile support, is if you want to support WML enabled phones also.</p>\n'}, {'answer_id': 65063, 'author': 'Ron McMahon', 'author_id': 2205331, 'author_profile': 'https://Stackoverflow.com/users/2205331', 'pm_score': 1, 'selected': False, 'text': "<p>You have only identified 3 handset 'platforms' as your target. One thing to consider is that there are a LOT more non-Blackberry / Windows Mobile / iPhone handsets out there and perhaps they will be the majority of your audience. (?)</p>\n\n<p>From how you describe your application (JUST text), you should be able to hit pretty much any Internet-enabled cell phone out there, which is pretty much every phone sold in the last eight years.  </p>\n\n<p>Rolling your own will likely give you more control over how the content is displayed and navigated, which your users will appreciate, but you will lose much of the automatic formatting and advanced interaction capability that something like ASP.NET Mobile may give you.  It is a trade-off that you might want to consider in light of where you anticipate your user community will go with this in the next 2 years.  </p>\n\n<p>Is it possible that they may ask for more of the desktop capability on the mobile side?  If it is a likely 'yes' (even more so when I think of the 3 platforms you are targeting) then I'd recommend some automated formatting / enablement tool like ASP.NET mobile.  If not, just roll your own and leave it simple and easy for your visitors to use.</p>\n"}, {'answer_id': 806592, 'author': 'Matt Lacey', 'author_id': 1755, 'author_profile': 'https://Stackoverflow.com/users/1755', 'pm_score': 0, 'selected': False, 'text': '<p>At Mix this year (2009) <a href="http://mdbf.codeplex.com/" rel="nofollow noreferrer">mdbf</a> was announced. See <a href="http://videos.visitmix.com/MIX09/T20F" rel="nofollow noreferrer">this video</a> or <a href="http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx" rel="nofollow noreferrer">this blog post by Scott Hanselman</a> for examples on using it to identify and redirect mobile browsers as needed.</p>\n'}]
['https://Stackoverflow.com/questions/59424', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5/']