ajax updating a table not using updatepanel?

  • Thread starter Thread starter soni2926
  • Start date Start date
S

soni2926

hi,
we currently have a site done using asp.net 2.0, one of the pages has
a datagrid, which displays some information. currently there is a
refresh button, but we want to change this so that every few secs we
can refresh it using ajax. using javascript to call the webservice,
we're not using updatepanels. once the webservice returns its's
results, as a dataset, how do we populate the table? I've done things
before updating labels and textboxes, but with tables...do we just add
a row using javascript to it?
 
yes. the browser dom api is close to xml dom api. you create nodes. basically
you create a tr nodes, and td nodes. and set the innerHTML. you can alsso
update the table in place, adding or deleteing the extra rows.

not sure why you don't use an update panel. it just does an ajax call which
returns the html and sets the inner html.

you could also have the webservice return the html and do it yourself.

in any case if you do a 2 sec refresh with ajax you will need to test for
memory leaks with IE, and fix your code. be sure to read the dom leak section:

http://msdn2.microsoft.com/en-us/library/bb250448.aspx


-- bruce (sqlwork.com)
 
Back
Top