locked
MaxHttpCollectionKey issue RRS feed

  • Question

  • User1901140160 posted

    Hi,

     

    I am facing an error while page post back which says"Opertaion Invalid due to current state of an object". When I set the value of maxhttpCollectionkey to 5000 it allows some more data rows to be posted back. But after certain number of records it shows the error. I need some dynamic solution to this problem as fixing the value won't solve my problem where data postback is dyanmic. It depends on the user what the amount of data he wants to post.

     

    Please suggest some alternative approach or implementation to this issue.

     

    Regards,

    Amit Agrawal

    Friday, April 19, 2013 1:46 PM

All replies

  • User551462331 posted

    the maxhttpcollection restriction is set to make asp.net application secure... this helps in avoiding DOS(denial of service) attacks

    http://support.microsoft.com/kb/2661403#appliesto

    i would rather think about restructuring the application flow in such a way that, it will not required so mane request values to be passed to the server in same request... it will also affect the performance/scalability of application

    may be u can think of wiazrd like flow wherein u will need to get data from user in batches

    hope this helps...

    Friday, April 19, 2013 6:03 PM
  • User1901140160 posted

    Hi,

    Thank you for replying to my query. I already read about the security updates released by Microsoft for preventing DoS attacks.

    Please give me some more idea about how can I get data from user in batches. Mine is a ASP.Net website and the requirement is that when user adds a data row in the grid on UI, it can copy it, add new data row or update/delete any data row. When he clicks on update button, the page is posted back carrying the whole data back to the server. This keeps on increasing everytime on post back. It shows error after certain number of records are entered depending upon the value of maxhttpCollectionkey. Since the data elements are more on the page which needs to be filled at a time so how can I take care of this.

    Sunday, April 21, 2013 11:54 PM
  • User551462331 posted

    when user adds a data row in the grid on UI, it can copy it, add new data row or update/delete any data row. When he clicks on update button, the page is posted back carrying the whole data back to the server

    one way, u can avoid this by avoiding complete postback and only passing changed row values to server using json object via javascript 

    or, limit the number of rows user can create/copy in a single request

    hope this helps...

    Monday, April 22, 2013 2:31 AM
  • User1901140160 posted

    Hi KK,

    Can I refer and use the implementation in below link in my application using MVP model. This link have implementation in MVC model. Please suggest.

    http://www.atlanticbt.com/blog/asp-net-mvc-using-ajax-json-and-partialviews/

    Tuesday, April 23, 2013 2:13 AM