views:

1908

answers:

3

I want to develop a mobile web application using asp.net 3.5 that can be viewed on an iPhone but there is no longer a template in VS2008 to enable mobile development. Can this be done ?

+1  A: 

the iphone uses the "regular" version of your website so developing a "mobile" version would nto accomplish what you're looking for. You should check the browser headers and redirect people to the iPhone version of your site if you detect mobile safari.

http://iphone.facebook.com/

Another option (if you're using MVC) is to have your controller detect the browser and show a different view if it catches mobile safari. This way you wouldn't need a duplicate site, just two sets of views.

Kyle West
A: 

The iPhone (at least mine which is the 3G version) have full support for "normal" web apps with Ajax and everything. So mostly any Ajax library would be 100% compatible with the iPhone, at least as long as the Ajax library is focusing on Open Standards and such...

[Shameless-Plug I work with Ra-Ajax]

Ra-Ajax have 100% support for iPhone except for "dragging and dropping" which interferes with scrolling on the iPhone. This means that you can use Ra-Ajax (which is an LGPL licensed and Free of Charge library for ASP.NET) to create a "normal" website which will work 100% perfectly (except for dragging and dropping, which is used in e.g. Ra-Windows etc) on the iPhone...

Even the really "advanced" stuff like our Ajax Calendar sample works flawlessly with the iPhone :)

Thomas Hansen
A: 

A web application (via Asp.Net 3.5) would be accessible over the Internet and would be accessible via the iPhone's Safari browser. There isn't anything truly special you need for it unless you want to make a true web application for mobile devices like the iPhone and Blackberries. In that case, you are looking purely at design aspects since it's still just a website. Due to the diversity of mobile browser capabilities, you'll need to do some research to find out what is recommended for the specific mobile browsers you want to access (the BBC's website comes to mind as a good example of mobile rendering).

Ultimately, the user agent is evaluated by your system and then it renders (or redirects) appropriately. Everything else is design if you want the page to render differently for the iPhone than any other browser on the web.

If you can get your hands on a copy of .Net magazine (a.k.a. Practical Web Design in the U.S.) issue 178, there is a great article on what you need to be aware of when doing mobile development and how the iPhone's browser is a lot different than others.

JamesEggers
Yes, I subscribe to .Net but forgot about that article. Will dig it out and have a look. - Thanks.
Ebircsa