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 168:
Line 169:                var sayfaBaslik = drSayfa["Baslik"].ToString();
Line 170:                if(sayfaBaslik.Substring(0,2) != "--")
Line 171:                {
Line 172:                    ltrlBaslik.Text = sayfaBaslik;

Source File: d:\vhosts\emseyhospital.com.tr\httpdocs\Sayfa.aspx.cs    Line: 170

Stack Trace:


[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14599300
   Sayfa.Page_Load(Object sender, EventArgs e) in d:\vhosts\emseyhospital.com.tr\httpdocs\Sayfa.aspx.cs:170
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4082


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