Noobie question: best way to maintain a list?

G

Guest

On an Asp.Net webpage, what's the best way to go about managing a list of
items?

When editing a library title I display a DataGrid of authors to which I'd
like to be able to add and remove. Ideally, I'd like to be able to work with
the list within a single page and not save the list until pressing an OK
button.

Should I keep a list of record IDs in a Session variable? Or postback the
list of IDs in the Request? Is there a way to hang onto a DataTable between
postbacks?

Thanks for any help,
Todd.
 
C

Cowboy \(Gregory A. Beamer\)

Todd said:
On an Asp.Net webpage, what's the best way to go about managing a list of
items?

Database. SQL Express is one that is free.
When editing a library title I display a DataGrid of authors to which I'd
like to be able to add and remove. Ideally, I'd like to be able to work
with
the list within a single page and not save the list until pressing an OK
button.

You can store the datatable in ViewState or Session between clicks./
Should I keep a list of record IDs in a Session variable?
No,.

Or postback the
list of IDs in the Request?

No need
Is there a way to hang onto a DataTable between
postbacks?

Yes, in ViewState. Be careful that you do not run into the native way
ViewState works, however, or you will delete records only to have them
reappear and visa/versa.
 
G

Guest

Thanks a bunch. Works great!

Cowboy (Gregory A. Beamer) said:
Database. SQL Express is one that is free.


You can store the datatable in ViewState or Session between clicks./


No need


Yes, in ViewState. Be careful that you do not run into the native way
ViewState works, however, or you will delete records only to have them
reappear and visa/versa.
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top