统计在线人数...

VS.NET 2003开发移动Web应用 五

[ 来源:转载 | 作者:佚名 | 时间:2006-5-29 下午 12:11:20 | 浏览:统计中... ]

移动.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> 

共有0人参与评价,平均得分:0分
评论内容只代表网友观点,与本站立场无关! 查看完整内容
   

当前在线人数
QQ:748838 MSN:allen_xia#msn.com E-mail:allenxia666#126.com QQ群:站长联盟北方区-北京(28200145) 站长联盟南方区-上海(67713522)