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 402:            Dim newFilName As String
Line 403:            'Try
Line 404:            newFilName = Riga.Item("Scannerizzazione").Substring(0, Riga.Item("Scannerizzazione").IndexOf("_")) & ".jpg"
Line 405:            'Catch ex As Exception
Line 406:            'newFilName = Riga.Item("Scannerizzazione")

Source File: D:\inetpub\webs\milanofotografoit\StoriaDocumentiManzoniani.aspx    Line: 404

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   Microsoft.VisualBasic.CompilerServices.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) +202
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +272
   ASP.storiadocumentimanzoniani_aspx.Page_Load(Object sender, EventArgs e) in D:\inetpub\webs\milanofotografoit\StoriaDocumentiManzoniani.aspx:404
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9174; ASP.NET Version:2.0.50727.9175