This is a migrated thread and some comments may be shown as answers.

Sorting Failure: Operation is not valid due to the current state of the object.

3 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kev
Top achievements
Rank 1
Kev asked on 17 Jan 2012, 11:02 AM
Hello,

I get an error when I try to sort the data in the grid.


The error is

Server Error in '/' Application.

Operation is not valid due to the current state of the object.

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.InvalidOperationException: Operation is not valid due to the current state of the object.

Source Error:

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.

Stack Trace:

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

[HttpException (0x80004005): The URL-encoded form data is not valid.]
   System.Web.HttpRequest.FillInFormCollection() +206
   System.Web.HttpRequest.get_Form() +68
   System.Web.HttpRequest.get_Item(String key) +39
   Telerik.Web.UI.RadCompression.IsAjaxRequest() +59
   Telerik.Web.UI.RadCompression.Compress(HttpApplication application) +720
   Telerik.Web.UI.RadCompression.PreRequestHandlerExecute(Object sender, EventArgs e) +76
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


My radgrid Setting
    <telerik:RadGrid ID="gridReports_Telerik" runat="server"  
                EnableAjaxSkinRendering="true"
                GridLines="Horizontal" CellPadding="0" BorderStyle="None"
                ClientSettings-AllowColumnHide="true" ClientSettings-EnableRowHoverStyle="true"
                ShowStatusBar="true" ShowHeader="true" AllowSorting="true"
                ShowFooter="true" RegisterWithScriptManager="true"
                EnableViewState="true"
                AllowFilteringByColumn="false"
                AllowMultiRowSelection="true"
                FilterItemStyle-Width="40" >
        <PagerStyle Mode="NextPrevAndNumeric" />
        <GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" />
        <MasterTableView TableLayout="Fixed" NoMasterRecordsText="No Record" >
        </MasterTableView>
        <HeaderStyle Height="50px" />
        <ClientSettings>
            <Scrolling EnableVirtualScrollPaging="false" />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
            <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
            <Resizing AllowColumnResize="true" EnableRealTimeResize="false"  ShowRowIndicatorColumn="false"
                      ResizeGridOnColumnResize="true" AllowRowResize="false" ClipCellContentOnResize="false" />
            
        </ClientSettings>
    
    </telerik:RadGrid>



I have used the httprequest to get some parameter from the url, so that the page url is http://xxx.com/test.aspx?operation=1&......
But the error message told that the URL encode is not valid.
What is the cause of the error and how to solve it? Thank you.

Regards,
Kev

3 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 24 Jan 2012, 03:44 PM
Kev:

I'm not sure if this is applicable to your situation, since I'm not privy to the details of your database update, but this recent post (1/18/2012) is worth reviewing, if you've not yet done so:

MS Update MS11-100 breaks sites with more than 1000 parameters at http://world.episerver.com/Blogs/Per-Nilsson/Dates/2012/1/MS-Update-MS11-100-breaks-sites-with-more-than-1000-parameters/

Hope this helps!    
0
Keith
Top achievements
Rank 1
answered on 24 Jan 2012, 07:10 PM
Typical MS answer to a problem: rather than fix the underlying implementation by backing the Request collection with a data structure not vulnerable to malicious O(N) search complexity (like, oh, maybe a binary tree?), they throw a magic number at it and hope it goes away.
0
Richard
Top achievements
Rank 1
answered on 24 Jan 2012, 08:10 PM
Well put, Keith. I agree wholeheartedly.

Cheers!
Tags
Grid
Asked by
Kev
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Keith
Top achievements
Rank 1
Share this question
or