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 25:             }
Line 26:             
Line 27:             MessaggioText.Text = "Sono interessato a maggiori informazioni sull'immobile Rif. " + TheList[0].Riferimento;
Line 28: 
Line 29:             ImmobiliRepeater.DataSource = TheList;

Source File: d:\inetpub\webs\agenziastudioimmobiliarecom\Immobili\Dettagli.aspx.cs    Line: 27

Stack Trace:


[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +67
   System.ThrowHelper.ThrowArgumentOutOfRangeException() +16
   System.Collections.Generic.List`1.get_Item(Int32 index) +19
   Immobili_Dettagli.Page_Load(Object sender, EventArgs e) in d:\inetpub\webs\agenziastudioimmobiliarecom\Immobili\Dettagli.aspx.cs:27
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2598


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8974