0

我有一个 ASP.net 表。在几个单元格中,我有两个下拉列表。每个下拉列表中选择的项目应该是从 SQLServer 2005 数据库中填充的。为此,我在后面的代码中逐步执行每个表格单元格中的控件。代码看到第一个下拉列表并填充它,然后转到下一个单元格。

我的 ASP

<asp:TableRow runat="server" ID="rowEnglish">
    <asp:TableCell ID="celCourseEnglish" runat="server">
        <asp:DropDownList ID="ddlCourseEnglish" runat="server" AutoPostBack="True">
            <asp:ListItem Value="0">English</asp:ListItem>
        </asp:DropDownList>
        <br />
        <asp:DropDownList ID="ddlCommentEnglish" runat="server" Font-Size="X-Small" DataSourceID="sqlDS_comment" DataTextField="comment" DataValueField="id" Width="125px">
        </asp:DropDownList>

我的 VB


For Each rowTemp In dtScores.Rows
    Dim tblRow As TableRow
    For Each tblRow In tblProgReport.Rows
        Dim celTemp As New TableCell
            For Each celTemp In tblRow.Cells
                Dim ctl As Control
                    For Each ctl In celTemp.Controls

                        If TypeOf ctl Is DropDownList Then
                        Dim ddlTemp As DropDownList = CType(ctl, DropDownList)
                        'select value from dropdown list

我已经尝试更改单元格中控件的顺序,但课程下拉菜单仍然是可见的。尝试删除课程下拉列表,然后评论下拉列表正确显示。整个事情都在母版页的内容占位符中。不知道为什么没有看到第二个下拉列表。

谢谢

4

1 回答 1

0

You may have to post your complete VB code. What are you doing once you find it? You are continuing in your foreach correct? You are not breaking out of it?

于 2009-05-22T18:59:19.930 回答