Best Practice: Passing Many ASP Variable To Client-Side Script?

M

Mario T. Lanza

Seasoned ASP Developers,

I have developed an ASP page that displays multiple rows of data with
which the user may work. As each row is updated, the graphical info
displayed immediately beside the row reflects the changes.
Fortunately, the script (although a little intensive and slow) runs
quickly enough (about 1 sec.) for updates against a single row.

The issue I am running into is that the client-side script must be run
for each and every row just as the page is initially loaded. If the
user displays 25 rows, he may have to wait about 25 seconds -- this is
too long.

I realize I could limit the number of rows displayed and offer the
user paging. This is not the answer for which I am looking. The
graphical data is displayed for comparison purposes; therefore, I
would like to display potentially many rows.

I believe that primary problems may be in the way that I provided the
data from database, to the ASP page, to the client-side script. I
wrote all of the data to hidden input fields and I obtain them in the
script using...

Sub ReflectUpdatesToRow(rowidx)
Dim field1, field2, field3
field1 = document.all.item("field1", rowidx).value
field2 = document.all.item("field2", rowidx).value
field3 = document.all.item("field3", rowidx).value
...
... update graphical data ...
...
End Sub

This works fine. The real issue is that it's slow. (I'm guessing
that the DOM has to work pretty hard to scrape the values from the
many hidden fields written to the page's underlying HTML.) I was
wondering if any of you seasoned developers have found better ways of
passing the data from many rows (e.g. a Recordset) into the
client-side script. Scraping values from HTML fields seems somewhat
inefficient. If you've got a better way, I'd be grateful to learn
from you.

Thank you.
Mario T. Lanza
Clarity Information Architecture, Inc.
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top