Refreshing / requerying GridView control when page is submitted?

  • Thread starter Thread starter planetthoughtful
  • Start date Start date
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
 
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#
 
Back
Top