Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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,,,,
 
if(!isPostBack){
//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
Edited 4-May-12 2:21am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please go through the links below....
 
Link 01[^]
 
Link 02[^]
 
Regards
Sebastian
  Permalink  
Rate this: bad
good
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.
  Permalink  
Comments
csharpnew at 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 at 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
Your Filters
Interested
Ignored
     
0 Shai Vashdi 1,518
1 Tadit Dash 350
2 Manas Bhardwaj 319
3 OriginalGriff 243
4 Sergey Alexandrovich Kryukov 240
0 Sergey Alexandrovich Kryukov 9,530
1 OriginalGriff 5,716
2 Peter Leow 4,320
3 Maciej Los 3,540
4 Abhinav S 3,373


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 4 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid