ASP.NET Tutorial/Mobile/MobileListItem

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Add MobileListItem to mobile:List

   <source lang="csharp">

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <script runat="server">

   public void Page_Load(Object sender, EventArgs e)
   {
     if (!IsPostBack)
     {
       for (int count=1; count < 100; count++)
       {
         MobileListItem listItem = new MobileListItem(count.ToString());
         List1.Items.Add(listItem);
       }
     }
   }

</script> <mobile:Form id="Form1" Paginate="true" runat="server">

   <mobile:List id="List1" runat="server"/>

</mobile:Form></source>