1

我正在尝试通过在数据网格标题中添加一个按钮来将 ModalPopup 添加到 GridView:

<asp:GridView ID="GridViewTradeDetail" />
    <Columns>
        <asp:TemplateField HeaderText="B/S">
            <HeaderTemplate>
                <asp:Button ID="ButtonShowBuySellPopup" runat="server" Text="Set B/S" />
            </HeaderTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("buy_sell") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("buy_sell") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="trade_date" HeaderText="TD" />
    </Columns>
</asp:GridView>

...

<asp:Panel ID="PanelBuySell" runat="server">
    ... panel content ...
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderBuySell" runat="server"
    TargetControlID="ButtonShowBuySellPopup" PopupControlID="PanelBuySell" />
<asp:Button ID="ButtonShowBuySellPopup" runat="server" Text="Set B/S" />

但是我收到一个错误,即 ModalPopupExtender 找不到按钮 ButtonShowBuySellPopup (如果我将按钮移出网格标题就可以了)。

如何将弹出窗口链接到 Gridiew 标题中的按钮(或者更好的是文本链接)?

谢谢

瑞安

4

0 回答 0