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

📄 asp-datalist.aspx

📁 ASP.NET Web Forms Techniques
💻 ASPX
字号:
<%@Page Language="C#"%>
<html>
<body>

<asp:datalist  id="dlTest" runat="server"
               forecolor="#000000"
               backcolor="#ffffff"
               cellpadding="3"
               gridlines="none"
               width="50%" >
  <itemstyle   font-name="tahoma,arial,sans-serif"
               font-size="12"
               backcolor="#ffffff" />
  <alternatingitemstyle font-name="tahoma,arial,sans-serif"
               font-size="2"
               backcolor="#ffff00" />

  <itemtemplate>
    <%# Container.DataItem %>
  </itemtemplate>

</asp:datalist>

</body>
</html>

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

void Page_Load() {

   // create an ArrayList of values to bind to
   ArrayList arrValues = new ArrayList(4);
   arrValues.Add("Microsoft");
   arrValues.Add("Sun");
   arrValues.Add("IBM");
   arrValues.Add("Compaq");
   arrValues.Add("Oracle");

   // set the DataSource property of the control to the
   // array and bind it to display the values
   dlTest.DataSource = arrValues;
   dlTest.DataBind();

}

</script>

⌨️ 快捷键说明

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