Server Error in '/' Application.

Length cannot be less than zero.
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: Length cannot be less than zero.
Parameter name: length

Source Error:


Line 108:            detail = finalDtls.Substring(0, finalDtls.IndexOf("ਇਹ ਵੀ ਪੜ੍ਹੋ"));
Line 109:            detail1 = finalDtls.Substring(finalDtls.IndexOf("ਇਹ ਵੀ ਪੜ੍ਹੋ"));
Line 110:            detail = detail.Substring(0,detail.LastIndexOf("<p "));
Line 111:            detail1 = detail1.Substring(detail1.IndexOf("</p>")+4);
Line 112:            finalDtls = detail + detail1;

Source File: c:\epaperhub-2019\story.aspx.cs    Line: 110

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14670769
   story.FilterDTLS(String dtls) in c:\epaperhub-2019\story.aspx.cs:110
   story.FillStoryWithJson(Int32 news_id) in c:\epaperhub-2019\story.aspx.cs:94
   story.Page_Load(Object sender, EventArgs e) in c:\epaperhub-2019\story.aspx.cs:20
   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.9176.0