objectlist.aspx

来自「asp.net技术内幕的书配源码」· ASPX 代码 · 共 46 行

ASPX
46
字号
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" %>

<Script Runat="Server">

Sub Page_Load
  Dim colArrayList As New ArrayList

  If Not Page.IsPostBack Then
    colArrayList.Add( "Star Wars" )
    colArrayList.Add( "Citizen Kane" )
  
    lstMovies.Datasource = colArrayList
    lstMovies.Databind()
  End If

End Sub  

Sub ObjectList_ItemCommand( s As Object, e As ObjectListCommandEventArgs )
  If e.CommandName = "Buy" Then
    ActiveForm = frmBuyTicket
  Else
    ActiveForm = frmShowDesc
  End If
End Sub
  
</Script>

<Mobile:Form id="displayMovies" runat="Server">

<Mobile:ObjectList
  ID="lstMovies" 
  OnItemCommand="ObjectList_ItemCommand"
  Runat="Server">
<Command Name="Buy" Text="Buy" />
<Command Name="Desc" Text="Desc" />
</Mobile:ObjectList>

</Mobile:Form>

<Mobile:Form id="frmShowDesc" runat="Server">
  <b>Great Movie!</b>
</Mobile:Form>

<Mobile:Form id="frmBuyTicket" runat="Server">
  <b>Buy Ticket!</b>
</Mobile:Form>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?