[我的ASP.net学习历程]数据梆定

类别:Asp 点击:0 评论:0 推荐:

<%@ Page Language="C#" AutoEventWireup="True" %>
<Script language="C#" runat="server">
void Page_Load(Object Sender,EventArgs e){
 ArrayList ArrValues=new ArrayList();
 ArrValues.Add("Misrosoft");
 ArrValues.Add("IBM");
 ArrValues.Add("SUN");
 ArrValues.Add("Compaq");
 ArrValues.Add("Oracle");
 
 MyRepeater.DataSource=ArrValues;
 MySelectList.DataSource=ArrValues;
 MyDownList.DataSource=ArrValues;
 MyDataGrid.DataSource=ArrValues;
 MydataList.DataSource=ArrValues;
 MyCheckBoxList.DataSource=ArrValues;
 MyRadioButtonList.DataSource=ArrValues;
 MyListBox.DataSource=ArrValues;
 
 Page.DataBind();
}

</Script>
<form runat="server">
<select id="MySelectList" runat="server"/><br>
<asp:dropdownlist ID="MyDownList" runat="server"></asp:dropdownlist><br>
<asp:datagrid ID="MyDataGrid" runat="server"></asp:datagrid><br>
<asp:datalist ID="MydataList" runat="server"></asp:datalist><br>
<asp:checkboxList ID="MyCheckBoxList" runat="server"></asp:checkboxList><br>
<asp:radiobuttonlist ID="MyRadioButtonList" runat="server"></asp:radiobuttonlist><br>
<asp:listbox ID="MyListBox" runat="server"></asp:listbox><br>
<asp:repeater ID="MyRepeater" runat="server">
 <itemtemplate>
  <%#Container.DataItem%>
 </itemtemplate>
</asp:repeater>
</form>

本文地址:http://com.8s8s.com/it/it8575.htm