代码之家  ›  专栏  ›  技术社区  ›  Kendrick

ListView插入事件-ListViewInsertEventArgs值集合为空

  •  0
  • Kendrick  · 技术社区  · 16 年前

    给定以下InsertItemTemplate(简化),我不会从事件对象的值集合中得到任何东西。

    <InsertItemTemplate>
                Item: 
                <asp:DropDownList ID="ItemInsertType"  
                         DataTextField="SearchItemName"
                         DataValueField="SearchItemID" runat="server" />
                Hide Location:
                <asp:TextBox ID="txtItemHideLocation" Text='<%# Bind("HideLocation") %>' runat="server"></asp:TextBox>
                <asp:Button ID="btnSearchSearchItemInsert" CommandName="Insert" runat="server" Text="Add" />
                <asp:Button ID="btnSearchSearchItemInsertCancel" CommandName="Cancel" runat="server" Text="Cancel" />
    </InsertItemTemplate>
    

    1 回复  |  直到 16 年前
        1
  •  1
  •   Brian Mains    16 年前

    我在那个程序集上使用了reflector,在我看来(可能是错误的),它只支持IBindableControl控件来自动提取到Values集合中。所以值不会包含任何不支持IBindableControl的控件的条目。TextBox不实现这一点,DropDownList也不实现。

    我通常使用InsertItem属性并直接使用FindControl提取控件引用。

    嗯。

    推荐文章