S
steve.craver
I am working with a multi-field search form which, when the form is
submitted, queries a database and returns the results into a paginated
GridView object. The site is being developed with master pages.
So far, I have had success in building the search form, and passing the
values entered by the user from the form to a results page, and
displaying the entire resultset using GridView. However, when I set
the AllowPaging option on the GridView tag to true, I get the following
error when I try to move from one GridView page to the next:
"Object reference not set to an instance of an object"
The objects that it is trying to reference, of course, are all of the
search parameters submitted on the search form which I was able to call
using the PreviousPage object. So far, all of this makes a sort of
sense to me; I'm pretty sure I know why the PreviousPage calls fail
when Gridview is set to allow paging.
So really, my question is: What is the best way of capturing the data
from a cross-page post back so that the values are retained in such a
way that a GridView object may be set to page its results?
submitted, queries a database and returns the results into a paginated
GridView object. The site is being developed with master pages.
So far, I have had success in building the search form, and passing the
values entered by the user from the form to a results page, and
displaying the entire resultset using GridView. However, when I set
the AllowPaging option on the GridView tag to true, I get the following
error when I try to move from one GridView page to the next:
"Object reference not set to an instance of an object"
The objects that it is trying to reference, of course, are all of the
search parameters submitted on the search form which I was able to call
using the PreviousPage object. So far, all of this makes a sort of
sense to me; I'm pretty sure I know why the PreviousPage calls fail
when Gridview is set to allow paging.
So really, my question is: What is the best way of capturing the data
from a cross-page post back so that the values are retained in such a
way that a GridView object may be set to page its results?