上一頁 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> |
當這個頁面顯示在移動設備上的時候,頁面的導航和顯示功能將為不同的設備編譯不同的顯示特性。(譯者注:設備不同看到的頁面也不同但是功能是一樣的)
有些設備,比如
掌上電腦,它可能顯示成下拉列表選擇表單。在
手機上它可能顯示為一個選項列表的選擇表單。