移动.NET列表
移动列表控件支持不同的输入和显示特性。
从List中选择
这个页面有两个表单:
| <%@ Page Inherits= "System.Web.UI.MobileControls.MobilePage"%> <%@ Register TagPrefix="Mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <script runat="server"> Sub Show_Price(sender As Object,e As ListCommandEventArgs) text1.Text=e.ListItem.Text & "=" & e.ListItem.Value ActiveForm=f2 End Sub </script> <Mobile:Form id="f1" runat="server"> <Mobile:List runat="server" OnItemCommand="Show_Price"> <Item text="Volvo" value="$30,000" /> <Item text="BMW" value="$32,000" /> <Item text="Audi" value="$34,000" /> </Mobile:List> </Mobile:Form> <Mobile:Form id="f2" runat="server"> <Mobile:Label runat="server" id="text1" /> </Mobile:Form> |
第一个表单有一个车的列表。
第二个页面显示价钱。当在第一个页上选择一个车这个页面就被激活。
当这个应用程序运行在移动的设备上这两个页面看起来就像下面的:

移动.NET选择列表
SelectionList控件支持下拉框,复选框以及单选按钮。
SelectionList
这个移动页面使用SelectionList让用户选择车:
| <%@ Page Inherits= "System.Web.UI.MobileControls.MobilePage"%> <%@ Register TagPrefix="Mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <script runat="server"> Sub Car_Click(sender as Object, e as EventArgs) ActiveForm=f2 t1.text=cars.Selection.Value End Sub </script> <Mobile:Form id="f1" runat="server"> <Mobile:SelectionList runat="server" id="cars" > <Item Text="Volvo" Value="$30,000" /> <Item Text="BMW" Value="$32,000" /> <Item Text="Audi" Value="$34,000" /> </Mobile:SelectionList> <Mobile:Command runat="server" OnClick="Car_Click" Text="Submit" /> </Mobile:Form> <Mobile:Form id="f2" runat="server"> <Mobile:Label id="t1" runat="server" /> </Mobile:Form> |
当这个页面显示在移动设备上的时候,页面的导航和显示功能将为不同的设备编译不同的显示特性。(译者注:设备不同看到的页面也不同但是功能是一样的)
有些设备,比如掌上电脑,它可能显示成下拉列表选择表单。在手机上它可能显示为一个选项列表的选择表单。本文:http://www.qqread.com/dotnet/i720996000.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- .NET移动与嵌入式技术 (5950篇文章)
- .NET开发手册 (5652篇文章)
- 电信运营商专栏 (4024篇文章)
- Wlan组网----家庭专题 (4184篇文章)
- .NET基础介绍 (713篇文章)
- .NET应用研究 (492篇文章)
- .NET实用开发 (1678篇文章)
- vb.net入门——ToolBar 控件的使用 (267次浏览)
- vb.net入门——OpenFileDialog 组件的使用 (75次浏览)
- vb.net入门——FontDialog 组件的使用 (52次浏览)
- vb.net用Graphics画一个五角星 (46次浏览)
- vb.net入门——FolderBrowserDialog 组件的使 (45次浏览)
- vb.net绘制干扰点 (44次浏览)
- vb.net入门——ColorDialog 组件的使用 (41次浏览)
- vb.net巧用ToolTip控件获取鼠标坐标 (39次浏览)
- 用vb.net创建一个鼠标绘图程序 (39次浏览)
- vb.net入门——SaveFileDialog 组件的使用 (38次浏览)



