2015-04-07 56 views
0

'/圖片'應用程序中的服務器錯誤。網站鏈接上的錯誤

源錯誤:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

堆棧跟蹤:

[ArgumentOutOfRangeException: Index and count must refer to a location within the string.Parameter name: count] 
    System.String.Remove(Int32 startIndex, Int32 count) +0 
    _Default.Page_Load(Object sender, EventArgs e) +114 
    System.Web.UI.Control.OnLoad(EventArgs e) +99 
    System.Web.UI.Control.LoadRecursive() +50 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 
+2

您是否有一些錯誤引用的代碼。 – 9Deuce

+0

它是一段相當大的代碼,並不完全確定錯誤發生在哪裏。任何想法在代碼上的錯誤是什麼?顯然它是一個字符串。只是不明白錯誤 –

+0

在下面回答。 – 9Deuce

回答

0

好像你調用此方法,同時通過整數值的字符串的開始索引和數量刪除對字符串無效的內容。例如,如果您的字符串長度爲5個字符,則startIndex必須介於0和4之間,count基本上爲4-startIndex。您不能從4個字符的字符串中刪除7個字符。如果字符串只有4個字符,您也不能將起始索引設置爲8。

這就是ArgumentOutOfRangeException是。您作爲參數傳遞給方法的參數超出了適用於該字符串的可接受範圍。

這就是爲什麼我以前要求代碼很重要,因爲我們可能會發現代碼的哪個部分正在創建或將不正確的值傳遞給該方法。