当前位置: 首页 > 网络学院 > 服务端脚本教程 > .NET Mobile > .NET Mobile Lists
The Mobile List Control supports different input and display properties.
This page has two forms:
<%@ 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> |
The first form has a list of cars.
The second page displays a price. This page is activated when a car is selected on the first page.
When the application runs on a mobile device the two pages will display like this:
Form 1
Volvo BMW Audi |
Form 2
Volvo=$30,000 |