devicespecific.aspx

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

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

<Script Runat="Server">

Sub Page_Load()
  Dim colMovies As New ArrayList()
  colMovies.Add( "Star Wars" )
  colMovies.Add( "Gone with the Wind" )
  colMovies.Add( "Citizen Kane" )
  
  lstMovies.DataSource = colMovies
  lstMovies.DataBind()
End Sub

Sub List_ItemCommand( s As object, e As ListCommandEventArgs )
  lblMovie.Text = e.ListItem.Text
  ActiveForm = form2    
End Sub

</Script>

<Mobile:Form runat="server" id="form1">
<Mobile:List 
  ID="lstMovies"
  OnItemCommand="List_ItemCommand"
  Runat="Server">

<DeviceSpecific>
<Choice Filter="IsHTML32">
  <HeaderTemplate>
  <h2>Welcome to the Movie Reservation System!</h2>
  </HeaderTemplate>

  <ItemTemplate>
  <p>
  <asp:Button
   Text='<%# Container.ToString() %>'
   Runat="Server" />
  </ItemTemplate>

  <FooterTemplate>
  <p>
  <small>All Contents &copy; copyright 2002 by the Company</small>
  </FooterTemplate>
</Choice>
</DeviceSpecific>

</Mobile:List>
</Mobile:Form>

<Mobile:Form runat="server" id="form2">
<b>You selected:</b>
<br/>
<Mobile:Label 
 ID="lblMovie"
 Runat="Server"/>
</Mobile:Form>

⌨️ 快捷键说明

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