首 页WAP教程WAP源码WAP电子书客户留言龙腾电脑维修网158网络电视本站论坛繁體中文
设为首页
加入收藏
联系我们
您当前的位置:WAP开发网 -> WAP教程 -> ASP.net WAP开发教程 -> 文章内容 退出登录 用户管理
栏目导航
· ASP WAP开发教程 · ASP.net WAP开发教程
· PHP WAP开发教程 · WML教程
· JSP开发WAP教程 · WAP 2.0
· 综合杂谈
热门文章
· WAP 2.0教程
· WML语言基础(WAP建站...
· 用VS2005实现ASP.NE...
· [组图] php WAp开发教程
· WML语言基础(WAP建站...
· VS.NET 2003开发移动...
· [图文] ASP技术进行动态WAP...
· [图文] WML语言基础(WAP建站...
· asp.net移动控件开发...
· [图文] 创建移动Web应用程序...
相关文章
· [图文] ASP.NET移动开发之S...
· ASP.NET 2.0移动开发...
· ASP.NET 移动 Web 窗...
· asp.net移动控件开发...
· ASP.NET 2.0移动开发...
· Wap页面使用asp.net...
· ASP.NET 2.0移动开发...
· ASP.NET 2.0移动开发...
· asp.net2.0移动控件...
· asp.net对wap的开发...
VS.NET 2003开发移动Web应用 六
作者:不详  来源:不详  发布时间:2006-2-25 13:40:51  发布人:tangyunfei

减小字体 增大字体


移动.net图像

  移动.NET在不同设备类型上显示不同图像的类型。

  Image控件

  不同的移动设备显示的兼容性不同。

  Image控件允许开发者为不同的设备类型指定图像的不同类型。

  Image类型

  有些移动设备显示GIF图像,有些显示BMP或者WBM图像,Image控件允许你为每个适合的图像类型指定不同的图像。

  这个移动页面显示一个图像:

<%@ Page
Inherits=
"System.Web.UI.MobileControls.MobilePage"%>
<%@ ReGISter
TagPrefix="Mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<Mobile:Form runat="server">
<Mobile:Image runat="server">
<DeviceSpecific>
<Choice ImageURL="image.gif" />
<Choice ImageURL="image.bmp" />
<Choice ImageURL="image.wbmp" />
</DeviceSpecific>
</Mobile:Image>
</Mobile:Form>

  当这个页面显示在Pocket PC上的时候,将显示成GIF图像。在手机上将根据收集的特性显示成WBMP或者BMP图像。

  移动.NET Utility

  Utility控件通过很少的代码支持复杂的用户界面。

  Adrotator 控件

  这个移动页面显示不同的广告:

<%@ Page
Inherits=
"System.Web.UI.MobileControls.MobilePage"%>
<%@ Register
TagPrefix="Mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<Mobile:Form runat="server">
<Mobile:AdRotator runat="server"
AdvertisementFile="advertisements.XML">
</Mobile:AdRotator>
</Mobile:Form>

  这个是广告(ad)文件叫做“advertisements.xml”:

<?xml version="1.0" ?>
<Advertisements>
<Ad>
<ImageUrl>image1.gif</ImageUrl>
<BmpImageUrl>image1.bmp</BmpImageUrl>
<WBmpImageUrl>image1.wbmp</WBmpImageUrl>
<NavigateUrl>http://www.1.com</NavigateUrl>
<AlternateText>Visit 1</AlternateText>
</Ad>
<Ad>
<ImageUrl>image2.gif</ImageUrl>
<BmpImageUrl>image2.bmp</BmpImageUrl>
<WBmpImageUrl>image2.wbmp</WBmpImageUrl>
<NavigateUrl>http://www.2.com</NavigateUrl>
<AlternateText>Visit 2</AlternateText>
</Ad>
<Ad>
<ImageUrl>image3.gif</ImageUrl>
<BmpImageUrl>image3.bmp</BmpImageUrl>
<WBmpImageUrl>image3.wbmp</WBmpImageUrl>
<NavigateUrl>http://www.3.com</NavigateUrl>
<AlternateText>Visit 3</AlternateText>
</Ad>
</Advertisements>

  日历控件

  这个也动页面显示一个日历:

<%@ Page
Inherits=
"System.Web.UI.MobileControls.MobilePage"%>
<%@ Register
TagPrefix="Mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<script runat="server">

Sub CalChanged(sender as Object,e as EventArgs)
lab1.Text="You selected " & c1.SelectedDate
ActiveForm=f2
End Sub

</script>

<Mobile:Form id="f1" runat="server">
<Mobile:Calendar id="c1"
OnSelectionChanged="CalChanged" runat="server" />
</Mobile:Form>

<Mobile:Form id="f2" runat="server">
<Mobile:Label id="lab1" runat="server" />
</Mobile:Form>

  这个例子里日历显示在第一个表单里,当用户从日历里面选择数据时,选择的日期显示在新的页面里。

  PhoneCall控件

  当用户选择文本这个移动页面显示文本“Tove’s number”和电话号码(555)555-5555。

  The PhoneCall Control

<%@ Page
Inherits=
"System.Web.UI.MobileControls.MobilePage"%>
<%@ Register
TagPrefix="Mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<Mobile:Form runat="server">

<Mobile:PhoneCall runat="server"
PhoneNumber="(555) 555-5555"
Text="Tove's number"
AlternateFormat="{0}" />

</Mobile:Form>

  这里的属性”AllternateFormat”是{0}。设置成这种显示将会显示为文本状。

  如果你是用值{1}它将显示成”PhoneNumber”。

  你也可以实用如下的构作AlternateFormat =”{0}is{1}”.这时候将会显示“Tove's number is (555) 555-5555”。

  Utility 控件

Name Function
AdRotator Displays advertisements
Calendar Displays a calendar
PhoneCall Calls a telephone number

  要了解更多的信息参考MSDN。
[] [返回上一页] [打 印] [收 藏]
下一篇文章:PHP编程--程序举例
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 管理登录
Copyright © 2002-2005 wapkf.com. All Rights Reserved .
浙ICP备06013604号|站长QQ:274273595