ajax updating a table not using updatepanel?

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?
 
B

bruce barker

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)
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top