I have a gridview that allows paging and uses a row command event.
The gridview column that caused the issue is:
<asp:LinkButton ID="LinkButton1" Runat="server" OnClientClick="return confirm('Are you sure you want to delete this item?');"
CommandName="ConvertDelete" CommandArgument="<%# Container.DataItemIndex %>">Delete</asp:LinkButton>
<ItemStyle BackColor="#FFC0C0" Font-Size="X-Small" />
The codebehind code that causes the issue is:
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
Dim row As GridViewRow = gridview1.Rows(index)
The error reads:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
The index value is greater than the page size. Everything works on Page 1 but fails on all other pages.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…