⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 objectlistmultiple.aspx

📁 asp.net技术内幕的书配源码
💻 ASPX
字号:
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" %>

<Script Runat="Server">

Public class Movie

  Private _movieTitle, _movieCat, _ticketPrice As String

  ReadOnly Property movieTitle As String
  Get
    Return _movieTitle
  End Get
  End Property

  ReadOnly Property movieCat As String
  Get
    Return _movieCat
  End Get
  End Property

  ReadOnly Property ticketPrice As String
  Get
    Return _ticketPrice
  End Get
  End Property

  Sub New( movieTitle As String, _
      movieCat As String, _ 
        ticketPrice As String )
    _movieTitle = movieTitle
    _movieCat = movieCat
    _ticketPrice = ticketPrice
  End Sub

End Class


Sub Page_Load
  Dim colArrayList As New ArrayList

  If Not Page.IsPostBack Then
    colArrayList.Add( new Movie( "Star Wars", "SciFi", "$7.98" ) )
    colArrayList.Add( new Movie( "Citizen Kane", "Drama", "$4.00" ) )
  
    lstMovies.Datasource = colArrayList
    lstMovies.Databind
  End If
End Sub  

Sub ObjectList_ItemCommand( s As Object, e As ObjectListCommandEventArgs )
  ActiveForm = frmSelectMovie
End Sub
  
</Script>

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

<Mobile:ObjectList
  id="lstMovies"
  AutoGenerateFields="False"
  LabelField="movieTitle"
  OnItemCommand="ObjectList_ItemCommand"
  Runat="Server">
<Field DataField="movieTitle" Title="Movie" />
<Field DataField="movieCat" Title="Category" />
<Field DataField="ticketPrice" Title="Price" />
</Mobile:ObjectList>

</Mobile:Form>

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

<b>Movie Selected!</b>

</Mobile:Form>

⌨️ 快捷键说明

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