Click here to Skip to main content
15,895,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i try .........

XML
<asp:TemplateField>
  <ItemTemplate>
     <asp:ImageButton ID="DeleteButton" runat="server"
        ImageUrl="images/del.png" AlternateText="Delete" ToolTip="Delete"
        CommandName="des" CommandArgument='<%# Container.DataItemIndex%>'
        OnClientClick="return confirmDelete();" />
  </ItemTemplate>
</asp:TemplateField>



with confirm msg it work well in the first page but get erorr in another pages

gridview index out of range


GridView1_RowCommand......

If e.CommandName = "des" Then

Dim rowIndex As Integer
rowIndex = Integer.Parse(e.CommandArgument.ToString)
' Response.Write(e.CommandArgument)
Dim s As Integer = GridView1.Rows(rowIndex).Cells(0).Text
rspnse.write(s)
end if
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900