Post back and grid view [modified]
-
Hello All i h a gridview with paging i h also edit button when i click on edit button of row 2 of page 4 it return index number 1 but infaact index number in whole data set is index=4*7 (page size)+1 which mean 29 for this i h three variable name as page number page size and index number but problem is on post back all these variables shows zero value except index number which show one in this case to avoid this i used static variable which retain last value but on web static variable cause some problem becase these are shared variable pls tell me how i can retain values without being affected by post back also on post back data set get empty any solution Regards Masood
-
Hello All i h a gridview with paging i h also edit button when i click on edit button of row 2 of page 4 it return index number 1 but infaact index number in whole data set is index=4*7 (page size)+1 which mean 29 for this i h three variable name as page number page size and index number but problem is on post back all these variables shows zero value except index number which show one in this case to avoid this i used static variable which retain last value but on web static variable cause some problem becase these are shared variable pls tell me how i can retain values without being affected by post back also on post back data set get empty any solution Regards Masood
What do you want to do with this index value? Do you want to use it to pick up the selected data row in the dataset? If so, you simply persist the id value using the DataKeyNames[^] property, and you can access the selected id from the
DataKeys
collection.