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 85:     public static string GetParentUriString(Uri uri, int index)
Line 86:     {
Line 87:         return uri.Segments[index].Replace("/", "");
Line 88:     }
Line 89:     public static string PaymentStep1(Reservation reservation)

Source File: c:\inetpub\vhosts\sofos.com.tr\httpdocs\App_Code\Tools.cs    Line: 87

Stack Trace:


[IndexOutOfRangeException: Index was outside the bounds of the array.]
   Tools.GetParentUriString(Uri uri, Int32 index) in c:\inetpub\vhosts\sofos.com.tr\httpdocs\App_Code\Tools.cs:87
   tr_Etkinlik_Detay.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\sofos.com.tr\httpdocs\tr\Etkinlik-Detay.aspx.cs:29
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1602


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