我正试图把一个VB.net下滴盒填入一个数据网。 基本上,我有一幅图像,用户需要从降幅清单中挑选该物品,这样我就可以在数据库中挽救它。
Dim DDLPlayColorList = New DropDownList
DDLPlayColorList = dgImages.FindControl("DDLPlayColorList")
Using oConn As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Using cmd As New SqlCommand("doGetAllPlayColours", oConn)
cmd.CommandType = CommandType.StoredProcedure
oConn.Open()
Using dr As SqlDataReader = cmd.ExecuteReader()
DDLPlayColorList.DataSource = dr
DDLPlayColorList.DataTextField = "playColour"
DDLPlayColorList.DataValueField = "playColour"
DDLPlayColorList.DataBind()
End Using
End Using
End Using
我试图利用发现控制功能来发现控制,然后对控制加以约束,但并没有改变。 错误
DDLPlayColorList不是经理成员。
This is my DataGrid:
<asp:DataGrid ID="dgImages" runat="server" Width="300" AutoGenerateColumns="false" ItemStyle-Width="300" ItemStyle-BorderWidth="3px">
<Columns>
<asp:TemplateColumn ItemStyle-BackColor="#eaeaea" ItemStyle-Width="100">
<ItemTemplate>
<a href="image.aspx?libid=<%#Container.DataItem("id")%>">
<asp:Image ID="imgCategoryThumb" CssClass="lightbox-thumb" runat="server" Height="100" Width="100" ImageUrl= <%#Container.DataItem("path")%> AlternateText="" />
</a>
<asp:DropDownList id="DDLPlayColorList" runat="server" CssClass="textfield">
</asp:DropDownList>
</itemtemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>