2012-10-06 5 views
0

가능한 중복 :
'Operation is not valid due to the current state of the object' error during postback작업으로 인해 asp.net에서 개체의 현재 상태에 유효하지 않습니다

[InvalidOperationException: Operation is not valid due to the current state of the object.] 
    System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2420862 
    System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +58 
    System.Web.HttpRequest.FillInFormCollection() +159 

[HttpException (0x80004005): The URL-encoded form data is not valid.] 
    System.Web.HttpRequest.FillInFormCollection() +217 
    System.Web.HttpRequest.get_Form() +104 
    System.Web.HttpRequest.get_HasForm() +9038959 
    System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97 
    System.Web.UI.Page.DeterminePostBackMode() +69 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +135 

는 또 다시

을이 오류를 얻기 내 코드 뒤에! 당신이 당신의 형태로 1000 개 이상의 데이터 요소가있는 경우 해당 오류는 발생하기 때문에 취소 버튼, 나는이 문제를 일으키는 당신의 데이터 그리드의 추측하고있어 데이터 그리드

if (((System.Web.UI.WebControls.Button)e.CommandSource).CommandName == "Cancel") 
    { 
     string value = (e.Item.FindControl("txtStatDesc") as System.Web.UI.WebControls.Label).Text; 

     if (value.Equals("Sent", StringComparison.CurrentCultureIgnoreCase)) 
     { 
      Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('You can not cancel the dta because it is in sent mode. Cancellation refused');", true); 

     } 


     else if (value.Equals("Prepared", StringComparison.CurrentCultureIgnoreCase)) 
      Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('DEF');", true); 

     else 
      Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('xyz');", true); 



    } 

답변

2

안에 있습니다. Microsoft의 서비스 거부 공격 (denial of service exploit) 문제를 해결하기 위해 2011 년에이 제한이 추가되었습니다.

제한에 대한 추가 정보 및 필요한 경우 한도를 올리는 방법 can be found here.

+0

여전히 같은 오류가 발생하는 작업이 없습니다 :/ – vini

+0

@vini 높이를 올렸습니까? 그리드가 얼마나 큽니까? –

+0

작품 덕분에 20,000 개까지 올렸지 만이 수치를 올리는 데 문제가 있습니까? – vini

관련 문제