上一页 1 2 3 4 5 6 下一页 
  移动.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> | 
  当这个页面显示在移动设备上的时候,页面的导航和显示功能将为不同的设备编译不同的显示特性。(译者注:设备不同看到的页面也不同但是功能是一样的) 
  有些设备,比如
掌上电脑,它可能显示成下拉列表选择表单。在
手机上它可能显示为一个选项列表的选择表单。