I have a grid created using a sql datasource in my asp page. So Sorting is done automatically using asp.net in build control(no codes added for sorting in vb.net).
But If I refresh the page or if I go to some other page, the sorting order disappears.
Is there a way to catch the previous sort order (sort direction and sort expression)?
On page
PreRenderevent store the current values ofGridView.SortDirectionandGridView.SortExpressionproperties in, for example,Session:On page
Initevent execute this code: