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

EnableEventValidation error when using pager button in Radgrid

3 Answers 418 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raji
Top achievements
Rank 1
Raji asked on 14 Nov 2011, 08:25 PM
Hi,

I am using a dynamically created radgrid with custom filtering and sorting. After the grid displays the results, I go to 2nd page and select a row and it opens a popup window. I close that window and click on the previous page pager button and it give me the below error.
"Event validation is enabled using <pages enableEventValidation="trur"/> in configuration or %@Page EnableEventValidation="true"%
I tried setting EnableEventValidation="true"% but it is not pagging correctly. I checked the forms and found similar problem but it did not solve my problem. Any help will be appreciated.

Thanks,
Raji

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Nov 2011, 06:03 AM
Hello Raji,

Make sure that you are using Advanced data binding using NeedDataSource event. Also Paging with disabled control ViewState is not supported. Try setting EnableViewState property of the RadGrid / MasterTableView is set to true.

-Shinu.
0
Raji
Top achievements
Rank 1
answered on 15 Nov 2011, 11:32 PM
I am using the NeedDataSource event. I enabled RadGrid1.MasterTableView.EnableViewState=true. Still I have the same problem.
0
Andrey
Telerik team
answered on 18 Nov 2011, 03:15 PM
Hi Raji,

The EventValidation feature is part from the Security settings of ASP.NET and it is enabled by default for the page. This kind of error is received when you are modifying the page on the client. By default the ASP Isapi filter expects to see the same control the was rendered the last time. If you have modified these controls and the EventValidation is enabled, exception is raised.. I think in your case, that has something to do with your custom paging. More about EvenValidation property of ASP.NET page you could find in this MSDN thread.

There are two ways to resolve this issue:

1. To disable event validation by setting value "false" to the EnableEventValiodation property in the @Page directive. This is the easier approach, but the security level will drop. It is up to you to decide this.

2. The second approach is to use RegisterForEventValidation method, like described here. This is the harder approach, but with ti you are preserving the security settings.


Regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Raji
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Raji
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or