devicespecific.aspx

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

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


<script language="C#" runat=server>

void Page_Load(object sender, EventArgs e)
{
  ArrayList colMovies = new ArrayList();
  colMovies.Add( "Star Wars" );
  colMovies.Add( "Gone with the Wind" );
  colMovies.Add( "Citizen Kane" );

  lstMovies.DataSource = colMovies;
  lstMovies.DataBind();
}

void List_ItemCommand( object s, ListCommandEventArgs e ) {
  lblMovie.Text = e.ListItem.Text;
  ActiveForm = form2    ;
}

</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 + -
显示快捷键?