Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > DataGrid with ViewState disabled

Thread Tools

DataGrid with ViewState disabled

Posts: n/a

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.


Reply With Quote
Posts: n/a
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.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
HtmlTextArea viewstate can not be disabled? Ryan Liu ASP .Net 1 07-13-2009 05:16 AM
textbox ignores disabled viewstate? PJ6 ASP .Net 2 12-02-2005 10:36 PM
Viewstate and disabled checkboxlist control Tommy Martin ASP .Net 0 08-12-2005 02:47 AM
if (control.visible == false) viewstate disabled? Alejandro Penate-Diaz ASP .Net 2 03-04-2005 02:50 PM
When can ViewState be disabled in WebServer controls? Ken Varn ASP .Net 4 11-09-2004 01:53 PM