views:

1104

answers:

5

Previously Visual Studio had templates for mobile web forms (not the mobile SDK). They appear to be gone in Visual Studio 2008 and the only solution I've seen is to download some templates from Omar here:

http://blogs.msdn.com/webdevtools/archive/2007/09/17/tip-trick-asp-net-mobile-development-with-visual-studio-2008.aspx

Is this supported anymore and if so is this the supported solution?

A: 

From what I can tell, this has not made it in there, supposedly they were to be included in SP1 of VS2008, but they were not.

Since the source of the templates came from blogs.msdn.com, I would guess that yes, it is the current supported method for building mobile targeted forms.

Mitchel Sellers
Since they were posted in a blog, I would think they are *not* officially supported.
Lucas
+4  A: 

I thought I'd come back to answer this. The mobile forms controls are still there and the templates provided unofficially above are the only ones available that I've found. I'm not sure why they took them out in Visual Studio 2008.

Without the templates, you mostly you just need to change your pages to derive from MobilePage instead of Page and your controls to derive from MobileUserControl instead of UserControl. To access the controls in markup, reference the mobile namespace like this:

<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>

and then you will be able to use the mobile controls like this:

mobile:form, mobile:textview ...

These are still the only way that I've found to create pages that are compatible with older phones and browsers. Newer phones and browsers of course use standard HTML for the most part and pages can be created the same as any other ASP.Net page.

cisellis
+1  A: 

Just saw a blog post about this on MSDN. MS got tired of trying to maintain definitions for every mobile device out there and is really pushing ASP.NET development. As you said earlier they are still supported, but no designer view. So, they are on the way out.

jwmiller5
A: 

About me is i design and test my Mobile Forms in VS 2005 where i can see design view and all. After this i just copy paste the code in VS 2008. I am doing this because of same reason that there is no any template for Mobile form controls in VS 2008.

prsthapit
A: 

In VS 2010 you should not create seperate website for mobile, but a standard ASP.NET website with pages designed for mobile best output. It is very important that you detect the mobile request properly and redirect user to mobile pages

Please take a look at http://51degrees.codeplex.com/. It is an ASP.NET open source module which detects mobile devices and provides auto redirection to mobile optimized pages when request is coming from mobile device. It makes use of WURFL mobile device database. For redirection there is no need to modify existing ASP.NET web application pages.

Amit Patel