Server Error in '/EventInfo' Application.

Count must be positive and count must refer to a location within the string/array/collection.
Parameter name: count

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: Count must be positive and count must refer to a location within the string/array/collection.
Parameter name: count

Source Error:


Line 273:    string InsertEventStyleCssComment(string commentName)
Line 274:    {
Line 275:      if (Event.StyleSheet1Css == null || Event.StyleSheet1Css.IndexOf("/*"+commentName,0,200)<0) return null;
Line 276:      string commentContent = Regex.Match(Event.StyleSheet1Css, @"\/\*"+commentName+@"((.|\n)*?)\*\/").Groups[1].Value;
Line 277:      return commentContent;

Source File: d:\Equinis\HippoBase\AspNetApps\EventInfo\Entries\CompetitorHorse.aspx    Line: 275

Stack Trace:


[ArgumentOutOfRangeException: Count must be positive and count must refer to a location within the string/array/collection.
Parameter name: count]
   System.String.IndexOf(String value, Int32 startIndex, Int32 count) +6927878
   ASP.entries_competitorhorse_aspx.InsertEventStyleCssComment(String commentName) in d:\Equinis\HippoBase\AspNetApps\EventInfo\Entries\CompetitorHorse.aspx:275
   ASP.entries_competitorhorse_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\Equinis\HippoBase\AspNetApps\EventInfo\Entries\CompetitorHorse.aspx:9
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   HippoBase.Web.EventInfo.Controls.EventInfoPage.Render(HtmlTextWriter writer) in d:\Equinis\HippoBase\AspNetApps\EventInfo\App_Code\EventInfoPage.cs:141
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239


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