Server Error in '/' Application.

Index and length must refer to a location within the string.
Parameter name: length

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 and length must refer to a location within the string.
Parameter name: length

Source Error:


Line 28:                             title='<%# Eval("Title") %>' /></a>
Line 29:                     </td>
Line 30:                     <td><%# App.CurentLang() == "en" ?  Eval("startdate").ToString().Get_MiladiDate().ToShortDateString() : Eval("startdate") %></td>
Line 31:                     <td><%# App.CurentLang() == "en" ? Eval("enddate").ToString().Get_MiladiDate().ToShortDateString() : Eval("enddate") %></td>
Line 32:                     <td><%#Eval("holdingdays") %></td>

Source File: d:\hostingspaces\sahargroup.ir\edu.sahargroup.ir\wwwroot\UCS\UC_CoursesList.ascx    Line: 30

Stack Trace:


[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +12953027
   Extention.Get_MiladiDate(String date) +60
   ASP.ucs_uc_courseslist_ascx.__DataBind__control4(Object sender, EventArgs e) in d:\hostingspaces\sahargroup.ir\edu.sahargroup.ir\wwwroot\UCS\UC_CoursesList.ascx:30
   System.Web.UI.Control.OnDataBinding(EventArgs e) +86
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +154
   System.Web.UI.Control.DataBind() +17
   System.Web.UI.Control.DataBindChildren() +187
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +164
   System.Web.UI.Control.DataBind() +17
   System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(ListViewPagedDataSource dataSource, Boolean dataBinding, InsertItemPosition insertPosition, ArrayList keyArray) +801
   System.Web.UI.WebControls.ListView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +1030
   System.Web.UI.WebControls.ListView.PerformDataBinding(IEnumerable data) +35
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +133
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +34
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +151
   System.Web.UI.WebControls.ListView.PerformSelect() +103
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   ProjectName.UCS.UC_CoursesList.Page_Load(Object sender, EventArgs e) +217
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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