Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error:


Line 22:     protected void Page_Load(object sender, EventArgs e)
Line 23:     {
Line 24:         TextBox1.Text = DetailsView1.Rows[1].Cells[1].Text;
Line 25:        // DetailsView1.Rows[5].Cells[1].Text = "TEST";
Line 26:         //int AmtRemaining = Int32.Parse(DetailsView1.Rows[17].Cells[1].Text);

Source File: h:\root\home\godparents-001\www\httpdocs\ChildProfile.aspx.cs    Line: 24

Stack Trace:


[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.Collections.ArrayList.get_Item(Int32 index) +13030049
   System.Web.UI.WebControls.DetailsViewRowCollection.get_Item(Int32 index) +15
   ChildProfile.Page_Load(Object sender, EventArgs e) in h:\root\home\godparents-001\www\httpdocs\ChildProfile.aspx.cs:24
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.9224.0