Server Error in '/' Application.

Index was outside the bounds of the array.

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.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:


Line 43:             int num = random.Next(Convert.ToInt16(strSplitArrUpperBound));
Line 44:             string[] strLineArray = strSplitArr[num].Split(ImageSeparator);
Line 45:             string currentimage = strLineArray[1].ToString();
Line 46:             string currentext = strLineArray[2].ToString();
Line 47: 

Source File: c:\inetpub\vhosts\silentnomoreawareness.org\httpdocs\photogallery\index.aspx.cs    Line: 45

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   photogallery_index.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\silentnomoreawareness.org\httpdocs\photogallery\index.aspx.cs:45
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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