Refreshing / requerying GridView control when page is submitted?

P

planetthoughtful

Hi All,

I have an ASP.NET page that is used to insert records into an SQL
Server table (see previous post). I also have a GridView on the same
page that displays the results of a query on the same table the records
are inserted into when the page is submitted.

I'm wondering if there's a way to requery / refresh the records being
displayed by the GridView when the page is submitted?

Currently when I submit the page, which inserts a record, the GridView
doesn't refresh / requery to display the newly inserted record.

Can anyone point me at what I should be doing in the page submit code
to make sure the GridView also displays the record just inserted?

Many thanks in advance!

Much warmth,

planetthoughtful
 
G

Greg Young

If you are inserting through your datasource, it should only be a matter of
rebinding to your datasource .. if not just redread your datasource and then
rebind it.

Cheers,

Greg Young
MVP - C#
 

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

Top