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 645:        if (image.IndexOf(split2, StringComparison.Ordinal) > -1) image = Customize.LayChuoi(image, ",", 0);
Line 646:
Line 647:        var filename = image.Substring(0, image.LastIndexOf(".", StringComparison.Ordinal));
Line 648:        var fileEx = image.Substring(image.LastIndexOf(".", StringComparison.Ordinal));
Line 649:

Source File: D:\WETREK\wetrek.vn\Product.aspx.cs    Line: 647

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14415580
   Product.GetImage(String image, String content) in D:\WETREK\wetrek.vn\Product.aspx.cs:647
   Product.GetTitleAndOtherTag() in D:\WETREK\wetrek.vn\Product.aspx.cs:542
   Product.Page_Load(Object sender, EventArgs e) in D:\WETREK\wetrek.vn\Product.aspx.cs:105
   System.Web.UI.Control.OnLoad(EventArgs e) +109
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


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