All pastes #189001 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-10-02 18:42 UTC
rendered paste body
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string selectedIndex = e.CommandArgument.ToString();
        throw new Exception(e.CommandArgument.ToString());
        if (e.CommandName == "editNewsletter")
        {
            editNewsletter(selectedIndex);
        }
    }

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  DataSourceID="newsletters" AllowSorting="True" onrowcommand="GridView1_RowCommand" style="margin-left:10px;">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" ItemStyle-Width="30" SortExpression="ID" />
                <asp:BoundField DataField="Date" HeaderText="Date" ItemStyle-Width="200" SortExpression="Date" />
                <asp:BoundField DataField="Title" HeaderText="Title" ItemStyle-Width="300" SortExpression="Title" />
               <asp:templatefield headertext="Email">
                    <ItemTemplate>
                        <asp:Button runat="server" CommandName="editNewsletter"  CommandArgument=<%# Eval("ID") %> Text="Edit"/>
                    </ItemTemplate>
                </asp:templatefield>
            </Columns>
        </asp:GridView>