M
Mario T. Lanza
I am developing an ASP class that allows users to view/edit many
records in a table directly via their browser. In order to reduce the
number of SQL statements being executed against the database I am
storing hidden input fields that I am using to determine whether or
not changes have occurred against a given row.
I've been able to do this in two possible ways.
1) I've stored the original values of the displayed fields in hidden
variables and use them for comparison purposed to determine if changes
have occurred.
2) I've stored one hidden input named "Modified" per row. Then on
each field I flag the corresponding Modified field via client-side
script whenever a field is changed.
The first method is more accurate but, I believe, has much more
associated overhead. It's more accurate that the second method in
only uncommon situations, such as the one described:
The user changes the value of a given field on a particular record
then, thinking better of the change, he reverts to the original value.
Using the first method, no update would be detected on the row.
Using the second method, an update would be detected though none has
been made.
If anyone considers one method better than the other please offer your
reasoning.
Mario T. Lanza
Clarity Information Architecture, Inc.
records in a table directly via their browser. In order to reduce the
number of SQL statements being executed against the database I am
storing hidden input fields that I am using to determine whether or
not changes have occurred against a given row.
I've been able to do this in two possible ways.
1) I've stored the original values of the displayed fields in hidden
variables and use them for comparison purposed to determine if changes
have occurred.
2) I've stored one hidden input named "Modified" per row. Then on
each field I flag the corresponding Modified field via client-side
script whenever a field is changed.
The first method is more accurate but, I believe, has much more
associated overhead. It's more accurate that the second method in
only uncommon situations, such as the one described:
The user changes the value of a given field on a particular record
then, thinking better of the change, he reverts to the original value.
Using the first method, no update would be detected on the row.
Using the second method, an update would be detected though none has
been made.
If anyone considers one method better than the other please offer your
reasoning.
Mario T. Lanza
Clarity Information Architecture, Inc.