1

如何获取 datalist 中的数据?

例如我有这个数据列表:

                   <asp:DataList ID="dlDynamicFiealds" DataKeyField="uniqID" runat="server" Width="100%"
                            OnItemDataBound="dlDynamicFiealds_ItemDataBound">
                            <ItemTemplate>
                                <div class="rows">
                                    <div class="field10" style="width: 15%">
                                        <asp:DropDownList ID="drpType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drpType_SelectedIndexChanged">
                                            <asp:ListItem Text="" />
                                        </asp:DropDownList>
                                    </div>
                                    <div class="field10">
                                        <asp:DropDownList ID="drpOlaviat" runat="server">
                                            <asp:ListItem Text="" />
                                        </asp:DropDownList>
                                    </div>
                                    <div class="field10" style="width: 15%">
                                        <asp:TextBox ID="txtName" runat="server" Width="95%" Text='<%#Eval("name")%>'></asp:TextBox>
                                    </div>
                                </div>
                                <div class="rows">
                                    <uc1:dynamicFieldsDetail ID="dynamicFieldsDetail" runat="server" />
                                </div>
                            </ItemTemplate>
                        </asp:DataList>

和我的cs代码填充这个:

if (Session["categoryDF"] != null)
        {
            List<dynamicFields> ldf = (List<dynamicFields>)Session["categoryDF"];

            dlDynamicFiealds.DataSource = ldf;
            dlDynamicFiealds.DataBind();

        }

现在我如何获取用户在数据列表中输入的数据?

4

0 回答 0