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 22: 	{
Line 23: 		string catdetail = Request.QueryString["catg"].ToString();
Line 24: 		string cat = catdetail.Substring(0, catdetail.IndexOf("["));
Line 25: 		//string cat1 = cat.Substring(0, 0).Trim();
Line 26: 		//string cat = Regex.Match(catdetail, @"^[^0-9]*").Value;

Source File: g:\pleskvhosts\ngpeducare.com\vgcmandi.co.in\gallerydetail.aspx.cs    Line: 24

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +13148884
   campus.Page_Load(Object sender, EventArgs e) in g:\pleskvhosts\ngpeducare.com\vgcmandi.co.in\gallerydetail.aspx.cs:24
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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