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

LinqDataSource and EnableViewState = false problem

0 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
martijnb
Top achievements
Rank 1
martijnb asked on 26 Jul 2016, 04:21 PM

Today I ran into an issue with a grid that is linked to a LinqDataSource via DataSourceId and no ViewState.

Initially, everything works fine but after a postback (paging, sorting, filtering), the Selecting event of the LinqDataSource is fired twice, once before page_load and once after. The problem is that this will cause an expensive query to run twice.

Anybody experienced this problem? With ViewState enabled, everything works fine.

Thanks, Martijn

No answers yet. Maybe you can help?

Tags
Grid
Asked by
martijnb
Top achievements
Rank 1
Share this question
or