Paging and Sql command

F

Franz

I have 2 pages. In the first page, user inputs a keyword and press the
button to go to the second page. In the second page, it will find the items
based on the keyword input. My sql select command contains the keyword. The
search result is displayed on a Pageing DataGrid.

When the user presses the page number, it will go to another page. But, I
need to get a new dataset again everytime the user requests a new page.
However, the search keyword from TextBox cannot be retrieved. So I can't
make the sql select command. I don't know where the keyword variable should
be put. I don't think Session is a good place. Any ideas? Thank you.
 
N

Nick Hodge

Franz

I am only setting out on this but as I understand it (In ASP.Net 2.0) you
would be able to store this in the session object successfully, but this
object is not strongly typed, so working in much the same way you could, I
think, use the role object

Equally, you could pass the textbox.text value in the crosspost url as a
query string

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 
O

Otis Mukinfus

I have 2 pages. In the first page, user inputs a keyword and press the
button to go to the second page. In the second page, it will find the items
based on the keyword input. My sql select command contains the keyword. The
search result is displayed on a Pageing DataGrid.

When the user presses the page number, it will go to another page. But, I
need to get a new dataset again everytime the user requests a new page.
However, the search keyword from TextBox cannot be retrieved. So I can't
make the sql select command. I don't know where the keyword variable should
be put. I don't think Session is a good place. Any ideas? Thank you.

That's how I have always done it. Can you explain why you don't think it's a
good way to do it? Maybe I'm doing something wrong.

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
N

neilmcguigan

why does it go to another page when the user clicks the next page
command? why not use a postback?

the querystring will be maintained after a postback, so you can store
the keyword there

neil
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top