Asp.net controls to avoid when developing for mobile phones - asp.net

Are there any guidelines regarding which asp.net controls (e.g. GridView, UpdatePanel...?) should be avoided when developing a web application for mobile phones?
My application is going to be used probably in iphone, blackberry or android enabled phone, so I would like to know if there are known problems related, for example, to control renderization or javascript handling in these platforms' mobile browsers.
Also, usability guidelines regarding best controls to avoid / use would also be appreciated.

At this point there is no Web Forms project template for mobile in ASP.NET Web Forms but there is in the new MVC release:
ASP.NET MVC 4 Mobile Features
Here's some info on creating mobile pages for Web Forms:
How To: Add Mobile Pages to Your ASP.NET Web Forms / MVC Application
Lastly, you might want to consider using jQuery Mobile.
As for controls to avoid? Definitely the richer ones like Calendar and GridView - but jQuery Mobile can offer you some options for the former...
You can use Modernizr for feature detection to better target specific mobile browsers.

I'd recommend checking:
That the generated pages validate on http://validator.w3.org/ - depending on which version of ASP.NET you're using, some of the controls throw out some bad HTML.
Depending on what you're doing, the GridView control may not render too well on small screens
Have a look at media queries to use different CSS styling for smaller screens
The first thing though could be to just try it out. Get the devices and visit a site that you know uses the controls and see what it's like. If you've not started on the site yet, consider using ASP.NET MVC to ensure that you're writing good HTML. You can use jQuery to do the ajax calls.

Related

Mobile Website Or ASP.NET website

I am trying to build a website which would mostly be used / browsed via mobile. When choosing the IDE to develop this, I find out that VS 2005 supports Mobile Web form while in other IDEs (VS 2k8, 2k12, 2k15) I didn't find Mobile Web Form.
I know the different between the Mob and Normal Web form, However, I didn't understand why Mobile Web form is not available in other IDEs which I mentioned?
If I design in normal web page, will it fit in mobile?
ASP.NET Webforms and ASP.NET MVC can be made responsive using CSS media queries. In early days, developer used to create separate pages for mobile and desktop. Now, you don't have to create separate pages with separate css and you can avoid device detection logic and desktop to mobile redirecting.
In simple words, media queries allows you to decide each and every styling property of the HTML components on Desktop, tabs and mobile. Please learn some basic here at CSS media queries.
Moving ahead I would suggest you to use the Bootstrap for asp.net and here's the tutorial to use ASP.NET Webforms with Bootstrap

Are ASP.NET mobile views only for ASP.NET MVC? or can they be used in plain ASP.NET as well?

I know in ASP.NET MVC you can have mobile views and do things like Index.mobile.cshtml and _Layout.mobile.cshtml and the server knows to serve these views/pages to mobile devices rather than Index.cshtml and _Layout.cshtml, but can this also be done in plain ASP.NET websites (not using MVC)?
Note : I am using razor syntax in the plain ASP.NET website.
Thanks in advance.
-- Lee
UPDATE :
To clarify, I am aware of the various browser detection methods. My question is specifically about whether mobile views in the form Index.mobile.cshtml are available in plain ASP.NET.
UPDATE (Functionality now included in ASP.NET latest release announced 18th February 2013) :
Talk of the devil.. this is now possible in a recent release..
Scroll down the page to the heading 'ASP.NET Web Forms Enhancements'
http://weblogs.asp.net/scottgu/archive/2013/02/18/announcing-release-of-asp-net-and-web-tools-2012-2-update.aspx
Take a look at this, brief description of mobile support for ASP.NET Web Forms:
How To: Add Mobile Pages to Your ASP.NET Web Forms / MVC Application
My understanding is that the alternate view modes support native to MVC4 is a result of the WebPages2 used by MVC, and is currently only used within MVC to resolve locating Views via the View Engine (combination of VirtualPathProvider and DisplayModeProvider). This is because views served up via MVC and requests via the URI do not map to physical locations on the server to serve up files from. ASP.NET on the other hand serves up files directly based off of the URI, and does not depend on a virtual path provider the way MVC does.
My guess would be that ASP.NET does not support automatically serving up alternate files based off of the same framework that MVC uses. That being said, I'm sure it would be possible to derive an implementation based off of the of the logic of VirtualPathProviderViewEngine that could achieve a similar result with ASP.NET, however I know of no implementation that does this currently. Best suggestion would be to see if you can find usages of DisplayModeProvider and see if anything pops up.
I'm not an expert so feel free keep looking but I thought I would offer what I can.
So I have come to the conclusion that this is not built in functionality in plain ASP.NET.
Though there are (IMO less elegant) alternatives.
Are ASP.NET mobile views only for ASP.NET MVC? Yes.
Update : This may be possible in latest release
http://weblogs.asp.net/scottgu/archive/2013/02/18/announcing-release-of-asp-net-and-web-tools-2012-2-update.aspx
-- Lee

asp.net mobile web for feature phones

I have an existing website done in asp.net webforms .net V4. Visual studio 2010
I want to add a simple mobile section to the site for low end feature phones.
Where do I start?
Do I just do a redirect on detection of a mobile device, and jump to a page with a VERY simple UI? or must I use a special framework for it to render correctly? Should I be using a WAP site?
Note that this is for very low end phones
Either you can redirect the user on detecting that he is using a mobile device or make some thing entirely new using phone gap or something.

Creating Mobile WebSite Which One To Use MVC Or .Net Mobile Controls

I want to built website for Mobile Device i was search on the internet and found out that we can create using Asp.net MVC or Asp.net Mobile SDK..... then my query is which one should i go with ? MVC or Asp.net Mobile ?
I recommend you combine ASP.Net MVC application with JQuery Mobile API. Thus, you can easily develop platform independent mobile applications which includes smartphone specific events and effects.

Creating ASP.Net Mobile Web Applications in VS 2010

I am trying to create a mobile version of a web application using VS2010 (.Net 3.5, not 4). When I search for information on ASP.net mobile I see a lot of references to mobile controls that adapt their HTML to the specific device requesting the page. Since I would like this app to be viewable on as many as devices as possible, it seems like it would be better to use the mobile controls rather than just create a smaller version of a web form. Apparently VS2008 and up do not include the mobile control templates, but you can download and install them separately. I did, but when I tried to create a test page I get a server error complaining that the assembly "System.Web.Mobile" could not be found. I double checked in my references and that assembly is included in the project. The file System.Web.Mobile.dll is also on the server running the app.
Is there something that I am doing wrong, or is developing a mobile web app in this way using VS2010 not possible?
Thanks,
Mike
I didnĀ“t found Mobile Web Forms templates for 2010 (for 2008). But Mobile Controls is a old and unused technology, you should use MVC.

Resources