Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand"
- DataSourceID="SqlDataSource1">
- <Columns>
- <asp:ButtonField CommandName="insertNew"
- Text="Button" />
- <asp:TemplateField>
- <ItemTemplate>
- <asp:Button ID="btnAdd" runat="server" CommandName="insertNew"
- CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
- Text="Add" />
- </ItemTemplate>
- </asp:TemplateField>
- <asp:TemplateField></asp:TemplateField>
- </Columns>
- </asp:GridView>
- Protected Sub GridView1_RowCommand(ByVal sender As Object, _
- ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs)
- If (e.CommandName = "insertNew") Then
- Dim index As Integer = Convert.ToInt32(e.CommandArgument)
- MsgBox(index)
- End If
- End Sub
- <httpRuntime maxRequestLength="32768" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement