CSDN博客

img bgu

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

发表于2004/9/21 20:16:00  1059人阅读

分类: [My ASP/ASP.net(C#)]

<%@ 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>

0 0

相关博文

我的热门文章

img
取 消
img