StartIndex Cannot Be Less Than Zero
Jun 29, 2010how to fix this error
StartIndex cannot be less than zero.
Parameter name: startIndex
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: StartIndex cannot be less than zero.
Parameter name: startIndex
Source Error:
Line 250: '-- replace spaces with "_" in the filename to make it URL encoding compatable
Line 251: Dim lastslash As Integer = pf.FileName.LastIndexOf("")
Line 252: Dim strnonspaces As String = strFilename.Substring(lastslash).Replace(" ", " ")
Line 253: strnonspaces = strnonspaces.Replace("&", "and")
Line 254: strFilename = strFilename.Substring(0, lastslash) + strnonspaces
error in line 252