Visual Studio .NET - Throw Exception
Asked By syed hanif
07-Apr-06 08:28 AM

System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown.
---> System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at System.Web.UI.Util.GetScriptLocation(HttpContext context)
at System.Web.UI.WebControls.BaseValidator.RegisterValidatorCommonScript()
at System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
You have a Substring method call
and the second parameter (length) is less than zero.
Is this what you are asking? This is in the GetScriptLocation method. So I guess your ASP.NET scripts arent' being found.
Hope that helps.
How To Solve This Exception

Can Any Body Tell Me Please What is Solutions For the Exception, Exception is Below
I am Using VS 2003 SDK 1.1 FRAMEWORK 1.1 (ASP.NET / C#.NET CODING)
Exception:
System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown.
---> System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at System.Web.UI.Util.GetScriptLocation(HttpContext context)
at System.Web.UI.WebControls.BaseValidator.RegisterValidatorCommonScript()
at System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Check Length
You have to check the value of the length your are passing. If it is less than zero, then pass a value of zero. Most probably you are using another method in the length such as the IndexOf method where if the character is not found it returns -1 as the value. If this is the case, then you have to change that value to 0.
sub = String1.Substring(0, String1.IndexOf('a') < 0 ? 0 : String1.IndexOf('a'));
Islamic Calendar [Very Urgent]
Hi
Any Body aware of Islamic Calendar and it is Functionality how to use in dot net application 2003 or 2005 in ASP.NET
kndly provide me any related resources about Islamic Calendar
I needed it is very urgent
kinds regards
sh syed hanif
Wise for Visual Studio.NET Wise for Visual Studio.NET By Peter A. Bromberg, Ph.D. To "Print This Page" Link Peter Bromberg Wise for Visual Studio .NET is a total and complete installation development system for creating and editing Windows® Installer
Visual Studio .net .NET Framework Hi NG, ich habe vor längerer Zeit mit Visual Studio .Net 2003 gearbeitet und überlege momentan auf einen neueren Stand upzudaten. Ein Visual Studio .Net 2008 scheint es nicht zu geben. Habe zumindest mit googeln nichts gefunden. Was
Visual Studio versioning . . . . how to tell? .NET Framework To my knowledge, Visual studio 6 was released in 1998, then Visual Studio .NET 2002 is VS 7, then Visual Studio .NET 2003 is VS 7.1, then Visual
visual studio.net 2003 and Access 2007 database .NET Framework Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now
Is Visual Studio self-hosting ? .NET Framework Does Microsoft use Visual Studio IDE, Visual Studio Debugger, Visual Studio Linker and Visual Studio compiler for developing Visual Studio ? Or is Visual Studio not