Click here to Skip to main content
13,088,701 members (55,930 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello, i have a problem with a concept ..

If i am reading a grid view from the database that shows all the products,
should i disable the view state for it ??

the teacher disable the view state , and when he binds the datagridview on page load event,
he tested if post back,,,,

//binding the data grid view

and he said we must disable the view state mode to false...

why is that ???
Please help
Posted 4-May-12 2:08am
Updated 4-May-12 2:21am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please go through the links below....

Link 01[^]

Link 02[^]

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

If you disable the viewstate then you will have to call the binding function on every postback. if you want to call it on first load then you will have to keep the viewstate enabled.
csharpnew 4-May-12 9:28am
Did the teacher made it right?
He said that logically the products table change in the database, so what we have to do it to disable the viewstate ??
Rahul Rajat Singh 4-May-12 9:36am
yes that part is in fact right but in that case we will have to bind the gridview either in page_load irrespective of postback or every place where we are updating the table

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 4 May 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100