如何在datalistview中获取数据?

时间:2012-06-05 06:30:38

标签: c# asp.net datalist

如何在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();

        }

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

0 个答案:

没有答案