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 72: 			var classBeginsAt = -1;
Line 73: 			var theClass = "";
Line 74: 			if (content.Substring(0, 50).Contains("<p class=\""))
Line 75: 			{
Line 76: 				tag = "<p class=\"";

Source File: c:\inetpub\vhosts\wb5rvz.org\rafino.org\httpdocs\App_Code\ContentCustomization.cs    Line: 74

Stack Trace:


[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +13220427
   rafino_membersModel.content.extractContentClass(String content) in c:\inetpub\vhosts\wb5rvz.org\rafino.org\httpdocs\App_Code\ContentCustomization.cs:74
   ASP._Page_PrintContent_cshtml.Execute() in c:\inetpub\vhosts\wb5rvz.org\rafino.org\httpdocs\PrintContent.cshtml:20
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +69
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +131
   System.Web.WebPages.StartPage.RunPage() +17
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +64
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +116


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