locked
Getting strange System.IndexOutOfRangeException RRS feed

  • Question

  • User1399398681 posted

    I am getting this strange System.IndexOutOfRangeException right at the beginning of a button's onCommand function.  It doesnt seem to happen if I just declare variables and exit the function, but it happens if I set any value to a variable, or even just do a Response.Write().

    All I do is the following:

    Line 230:        protected void getTimes(object sender, EventArgs e)
    Line 231:        {
    Line 232:            string releaseIDList = "";
    Line 233:           
    Line 234:            foreach (RepeaterItem releaseItem in rptReleaseType.Items)

    Here is the stack trace: 

    [IndexOutOfRangeException: Index was outside the bounds of the array.]
       localhost.ReportNumDefects.getTimes(Object sender, EventArgs e) in C:\views\astead_dev_whql-web\STC_CERT\WHQLWebsite\ReportNumDefects.aspx.cs:232
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

     I dont understand why its doing this, any help would be appreciated.  Thanks

    Friday, September 5, 2008 12:06 PM

Answers

  • User1399398681 posted
    After some playing around with this, I figured out that its actually crashing much later in the function, it just says it stopped at the beginning... ?
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 5, 2008 2:36 PM