Public Class myDropDownList
Inherits Control
Implements INamingContainer
Protected Overrides Sub CreateChildControls()
Dim DropDownList1 As New System.Web.UI.WebControls.DropDownList
DropDownList1.DataSource =
DropDownList1.DataMember =
DropDownList1.DataValueField =
DropDownList1.DataBind()
Me.Controls.Add(DropDownList1)
End Sub
End Class
用这个代替DropDownList应该能行. 如果不同DataList's ITEM中的DropDownList用不同数据绑定, 也可以做到
Inherits Control
Implements INamingContainer
Protected Overrides Sub CreateChildControls()
Dim DropDownList1 As New System.Web.UI.WebControls.DropDownList
DropDownList1.DataSource =
DropDownList1.DataMember =
DropDownList1.DataValueField =
DropDownList1.DataBind()
Me.Controls.Add(DropDownList1)
End Sub
End Class
用这个代替DropDownList应该能行. 如果不同DataList's ITEM中的DropDownList用不同数据绑定, 也可以做到