What Happened to ASP.Net Mobile Web Forms?

2019-04-12 21:50发布

问题:

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?

回答1:

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:

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.



回答2:

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.



回答3:

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.



回答4:

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.