Developing web application for mobile phones using .NET

This is how you can develop web application for mobile phones using .NET.

When I started thinking of developing a web application for mobile, I came across a lot of programming languages and technologies (BlackBerry /Apple IPhone having own development framework, supported by there company). However, they have limited to set of users and I would not want to pursue further in it.

After a bit of searching over internet, I found that most if not all of the offerings could be achieve by using .Net. Although it may not be that efficient as developing environment specific application that you can develop using its own development environment, but you will be able to reach larger audience (Read : people using window mobile based appliances).

As this scenario worked fine for me, I just thought of mentioning the stuff here.

Add meta proper meta tag for mobile, couple of tags with description can be found here[^] .

Now once you have added meta tag it is time to design a page for mobile. Before getting into the designing the page, you need to understand that the width of mobile is not as the normal monitors. Therefore best is to specify width in % and not in pixels, even if you define the width in pixels make sure you don't break things.(To check this out test it in the simulators, although simulators don't give 100% accurate results, this is how you can test if you don't have actual device to test available all the time).

The way each browser interprets your page is different so you have to be careful while writing code.but as long as you are writing in basic html and asp.net which of the browsers understand you don't have to worry about this. Normal(not designed for mobile) third party control can be messy as you may not be aware whether they support mobile plateform, results can be devastating.

If you are using javascript then make sure it is enabled, and if not ask the user to enable it, better is to avoid javascript as it still takes fair portion of market.

Some browsers support ECMAScript[^]so make sure you have included ECMAScript tag either on the page or config file. Once you have done this you have added lot of capability your app, without ECMAScript you black berry would not respond to __doPostBack(); event and now you can even use controls like .Net tree view control and etc.

To display the page properly so that it occupies full width in "Landscape Mode" use following meta tag with "name="viewport" content="width=device-width,user-scalable=no""

This is enough for writing the mobile application now you can write the code and hope it works as expected in 90% of cases for the rest 10% of cases google[^] is our friend, using that you can find abundant material on internet .

@iyalaras, when you say load a .NET application in mobile environment NOT all of them support .NET written code, having said that if you can for sure use many extended frameworks that allows you to use .NET for writing code and then converts it to desired from (Xamarin is one such example).

but if you want a website or web application to be working in all of them with bit of work around like we do for cross browser application this can be achived.