StartIndex Cannot Be Less Than Zero

Jun 29, 2010

how 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

View 5 Replies


Similar Messages:

StartIndex Cannot Be Larger Than Length Of String?

Feb 25, 2011

I m binding a checkboxlist after that i get this error startIndex cannot be larger than length of string.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved