日期:2014-05-17  浏览次数:20455 次

gridview的RowCommand事件不执行
在模板列内放了两个linkbutton,但是触发不到RowCommand时间怎么个情况?求指教。
<asp:GridView ID="gdv_IndexPic" style=" width:700px;" runat="server" 
        AutoGenerateColumns="False" EmptyDataText="没有可显示的数据记录。" AllowPaging="True" CellPadding="4" 
        ForeColor="#333333" GridLines="None" 
        onpageindexchanging="gdv_IndexPic_PageIndexChanging" PageSize="5" 
        onrowdatabound="gdv_IndexPic_RowDataBound" 
            onrowcommand="gdv_IndexPic_RowCommand">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:TemplateField HeaderText="图片">
                <ItemTemplate>
                    <img src='<%#Eval("PicAddr") %>' height="80px" width="80px" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="图片名称" DataField="PicName" />
            <asp:BoundField HeaderText="所属景点" DataField="SceneryName" />
            <asp:TemplateField HeaderText="操作" ShowHeader="false">
                <ItemTemplate>
                   <asp:LinkButton ID="lbtn_Update" runat="server" CommandName="_Update" CommandArgument='<%#Eval("ID") %>'>修改</asp:LinkButton>
                    <asp:LinkButton ID="lbtn_Del" runat="server" CommandName="_Del" CommandArgument='<%#Eval("ID") %>'>删除</asp:LinkButton>
                </ItemTemplate>
                
            </asp:TemplateField>
        </Columns>
        
    </asp:GridView>
GridView RowC