<%@ Import Namespace="MYCOM" %> <Script Runat="Server"> Sub Page_Load(Src as Object, E As EventArgs) dim myDataObj as new MYCOM.DataObj if Not Page.IsPostBack Then drpCategories.DataSource = myDataObj.Categories() drpCategories.DataValueField = "FieldName1" drpCategories.DataTextField = "FieldName2" drpCategories.DataBind() End if End Sub </Script> <form runat="Server"> <asp:DropDownList Id="drpCategories" runat="Server" /> <asp:Button runat="Server" Text="查询" /> </form>