DataGrid with ViewState disabled

M

Melvyn

Hi,

I am listing the data from a SQLServer database to an aspx
page using DataGrid.

I call the binding function on the Page_PreRender event so
that I dont need to call the binding function everytime
for Page Index change or Sorting.

Now when I disable the ViewState, the Paging does not work
because PageIndexChanged event does not fire.

Now I need to disable the Viewstate to reduce network
traffic towards client side and I am binding the grid
everytime in the Page_PreRender event. But with ViewState
disabled my Paging does not work, is there any way to work
around this.

Any help is appreciated.

Regards

Melvyn
 
C

chris_shi

I believe you need to rebind the datagrid in either Page_Init or
Page_Load because the pageindexchanged event is handled after Page_Load
and before Page_PreRender.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top