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 333:
Line 334:
Line 335:               strTitle = strTitle.Substring(0, 1).ToUpper() + strTitle.Substring(1, strTitle.Length - 1);
Line 336:
Line 337:               String strUrlTitle = ((DataRowView)e.Item.DataItem).Row["Url"].ToString().ToLower();

Source File: e:\inetpub\vhosts\expertsmind.com\httpdocs\Avtar\Default.aspx.cs    Line: 335

Stack Trace:


[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +12953527
   Avtar_Default.dlRelatedPosts_ItemDataBound(Object sender, DataListItemEventArgs e) in e:\inetpub\vhosts\expertsmind.com\httpdocs\Avtar\Default.aspx.cs:335
   System.Web.UI.WebControls.DataList.OnItemDataBound(DataListItemEventArgs e) +122
   System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +153
   System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +659
   System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +65
   System.Web.UI.WebControls.BaseDataList.DataBind() +84
   Avtar_Default.Page_Load(Object sender, EventArgs e) in e:\inetpub\vhosts\expertsmind.com\httpdocs\Avtar\Default.aspx.cs:170
   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.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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