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 90:                                                         <h4>@(ViewBag.videos[i].Categories_Name != null ? ViewBag.videos[i].Categories_Name[0] : "")</h4>
Line 91:                                                         <h2>@ViewBag.videos[i].Title</h2>
Line 92:                                                         <h6><span class="author"><strong>@(ViewBag.docs[i].AuthorName != null ? @ViewBag.docs[i].AuthorName[0].ToString() : "")</strong></span><span class="date">Hace <strong>@DateTime.SpecifyKind((string.IsNullOrEmpty(ViewBag.docs[i].PublicationDate.ToString()) ? DateTime.Now : Convert.ToDateTime(ViewBag.docs[i].PublicationDate)) ?? DateTime.Now, DateTimeKind.Utc).ToString(CultureInfo.InvariantCulture)</strong></span></h6>
Line 93:                                                     </div>
Line 94:                                                 </div>

Source File: C:\inetpub\wwwroot\mediosred.net\Default\Views\Search\Results.cshtml    Line: 92

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) +72
   System.Collections.Generic.List`1.get_Item(Int32 index) +14616023
   CallSite.Target(Closure , CallSite , Object , Int32 ) +88
   System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +716
   ASP._Page_Default_Views_Search_Results_cshtml.Execute() in C:\inetpub\wwwroot\mediosred.net\Default\Views\Search\Results.cshtml:92
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +147
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +31
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +436
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +436
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +187
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +27
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +41
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +602
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128


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