Cross-Page PostBack, Master page, and GridView issue in ASP.Net 2.0

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top