Mobile device web application development ---- (example)

zhaozj2021-02-16  52

Mobile .NET example

Mobile ASP.NET page

Moving controls are blocks primarily building mobile applications.

Moving controls and web controls in ASP.NET are very similar.

If you are not familiar with ASP.NET development, you can leave here first go to ASP.NET TUTORIAL learning.

This ASP.NET page displays "Hello W3Schools" on a mobile phone that can identify WML. (Translator Note: WML is a XML-based tag language).

<% @ PAGE

Inherits = "System.Web.ui.MobileControls.MobilePage"%>

<% @ Register

Tagprefix = "mobile"

Namespace = "system.web.ui.mobileControls"

AskMBLY = "System.Web.Mobile"%>

<

MOBILE

: Form runat = "server">

<

MOBILE

: Label Runat = "Server"> Hello W3Schools

MOBILE

: Label>

MOBILE

: Form>

The PAGE instruction here tells ASP to use (inherit) is the mobile page processing replacement formal page processing (just like a traditional browser).

The Register directive definition here will be used in the mobile control, but you can use any prefix you like.

Here the tab tells the server to create a mobile FORM control.

The tag tells the server to create a mobile text for the Label control of "Hello W3Schools".

This ASP.NET page output

When the ASP page is executed, it will generate the following output to mobile phones that can use WAP (Wireless Application Protocol)

DOCTYPE WML PUBLIC

'- // WAPFORUM // DTD WML 1.1 // en'

'http://www.wapforum.org/dtd/wml_1.1.xml'>

Hello W3Schools

The following different outputs will be generated on the Pocket PC:

Action = "eXample.aspx">

Hello W3Schools

in conclusion

Moving .NET will generate WML encoding to identify WAP, generate HTML encoding to devices such as Pocket PC.

Corresponding to complex browsers, mobile

.NET

Will be able to output a proper output to develop a powerful tool to develop an app to serve different mobile devices.

转载请注明原文地址:https://www.9cbs.com/read-23921.html

New Post(0)