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 204:                ListProduct = ProductBL.GetProductListByCategoryID(category.CategoryID, "FriendlyUrl, Moduls, ModelName, CategoryID, ProductImage,Description, ProductID,PublishDateChar,Price, Price1, Price2, ProductUnit, ExchanRateID, Viewed,ListCategoriesAttributes", SortOrder, "Hide=0 AND GETDATE() >= CONVERT(datetime,PublishDate)", C.ROWS_PRODUCTCATEGORY, page, out _outR);
Line 205:                string current_page = Request.RawUrl;
Line 206:                current_page = UrlHelper.AddParameterToUrl(current_page, "page", "");
Line 207:                split_bar = Paging.Render_Paging(page, C.ROWS_PRODUCTCATEGORY, _outR, current_page);
Line 208:            }

Source File: c:\Website\truyenaudio.org\Controls\ProductCategory.ascx.cs    Line: 206

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14599229
   Ebis.Utilities.UrlHelper.AddParameterToUrl(String oldUrl, String para, String value) +789
   Controls_ProductCategory.BindData() in c:\Website\truyenaudio.org\Controls\ProductCategory.ascx.cs:206
   Controls_ProductCategory.Page_Load(Object sender, EventArgs e) in c:\Website\truyenaudio.org\Controls\ProductCategory.ascx.cs:86
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Control.LoadRecursive() +185
   System.Web.UI.Control.LoadRecursive() +185
   System.Web.UI.Control.LoadRecursive() +185
   System.Web.UI.Control.LoadRecursive() +185
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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