WAP之家:为您提供最全最新的WAP技术,CP.SP.3G等行业资讯。 WAP之家交流论坛全新开放 点击进入>>
WAP资讯 | 3G动态 | SP动态 | 运营商动态 | 内容商动态 | 制造商动态 | 论坛讨论>> 每次自动访问
WAP技术 | WAP源码 | 手机编程 | 手机源码 | 无线技术 | J2ME技术 | 手机软件 添加到收藏夹
IVR技术 | SP资料 | SMS MMS技术 | 商业方案 | IVR下载 | 书籍教程 | 工具软件 语言:繁體中文

WAP之家技术文章WAP教程网站教程.NET Mobile 例子

.NET Mobile 例子
作者:佚名  来源:本站整理  发布时间:2008-3-14 15:12:16

The Mobile ASP.NET Page

Mobile Controls are the main building blocks of mobile applications.
Mobile Controls(手机控件)是手机应用程序的主要组件。

Mobile Controls are similar to Web Controls in ASP.NET.
Mobile Controls(手机控件)和ASP.NET的Web Controls(网页控制)很像。

The following ASP.NET page displays "Hello W3Schools" as a WML card in a WML enabled cell phone:
下面的ASP.NET页面把"Hello W3Schools"作为一个WML卡显示在WML可用的手机里。

<%@ Page
Inherits="System.Web.UI.MobileControls.MobilePage" %>

<%@ Register
TagPrefix="mob"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mob:Form runat="server">
<mob:Label runat="server">Hello W3POP</mob:Label>

</mob:Form>

The Page directive tells ASP to use (inherit) mobile page handling instead of regular page handling (like the one used for traditional browsers).
页面指示告诉ASP用手机页面处理代替常规页面处理(像用于传统浏览器的处理)

The Register directive defines the prefix that will be used for mobile controls. We have used "mob",  but you can use any prefix you like.
登记指示定义了将用于手机控件的前缀。在这我们用了"mob",但前缀是可任意取的。
 

The <mob:Form> element tells the server to create a mobile form control.
<mob:Form>元素告诉服务器创建一个手机窗口控制

The <mob:Label> element tells the server to create a mobile label control with the text "Hello W3Schools".
<mob:Label>元素告诉服务器创建一个含有文本"Hello W3Schools"的手机标签控制

When the ASP .NET page executes, it will produce the following output to a WAP enabled mobile phone:
当ASP .NET执行时,会在WAP可用的手机上产生这样的输出

<?xml version='1.0'?>

<!DOCTYPE wml PUBLIC
'-//WAPFORUM//DTD WML 1.1//EN'
'http://www.wapforum.org/DTD/wml_1.1.xml'>
<wml>
<card>
<p>Hello W3POP</p>
</card>
</wml>

and this output will be produced for a Pocket PC:
对于Pocket PC(微型电脑)来说,会输出以下内容:

<html>

<body>
<form id="ctrl1" name="ctrl1" method="post"
action="example.aspx">
<div>Hello W3POP</div>

</form>
</body>
</html>

 


Conclusion
综述

.NET Mobile will generate WML code for WAP enabled cell phones and HTML code for devices like the Pocket PC.
.NET Mobile会为WAP产生一个WML代码,它可以使手机使用WAP,以及让微型电脑(Pocket PC)装置支持HTML代码。

By detecting the browser, .NET Mobile will output correct content, providing developers with a powerful tool to develop single applications that will serve many different mobile devices.
通过探测浏览器,.NET Mobile将会输出一段正确内容,并通过一个强大的工具开发出一个单独的应用程序(此应用程序支持不同的移动设备)将这部分内容提供给开发者。

[] [返回上一页] [打 印]
文章评论

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 0分

内 容:

         (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码