Share via


Designing a Mobile Web Application

When designing your ASP.NET mobile Web application, it is beneficial to separate the definition of your user interface (UI) from your business logic and data store. Mobile Web Forms pages, like ASP.NET Web Forms pages, enable you to easily separate rendering from logic. For example, you can place the UI definition in an .aspx file, with the associated event handlers and other UI code in either the same file or a code-behind page. You can then place business logic code in separate classes, written in the language of your choice (that is supported by the common language runtime).

A key advantage to separating rendering and logic is that you can reuse code for a desktop and a mobile Web application. If you have written an ASP.NET Web application that supports desktop Web browsers, you can reuse the business logic code in a mobile Web application. You must write one set of Web Forms pages for the desktop, and one set of mobile Web Forms pages for mobile devices, but they can share the same business logic code. To help facilitate this, mobile Web Forms pages are capable of containing multiple forms, so that you can factor your application into similar units for both desktop and mobile UI.

By reusing business logic, you can provide a more integrated experience for your mobile users by:

  • Reducing the cost of development by using common code.
  • Providing a fast time-to-market turnaround.
  • Leveraging existing ASP.NET skill sets.

For example, if you allow a user to customize your Web application, you can share the user profile across your desktop and mobile Web applications. This allows you to enable scenarios in which the user can configure settings by using a desktop browser, and use those same settings in the mobile Web application.

See Also

Application Developer's Guide | Creating ASP.NET Mobile Web Applications | Developing Mobile Web Applications