Tracking only the modified values within the asp.net repeater - a step-by-step guide

In my editable nested repeater, I have data that is displayed to the user and also used for saving any updates made by the user. I am looking for a way to detect when a specific cell/row has been modified so that I can update only that row in the database without saving all the data again. Should I use JavaScript or server-side code to accomplish this? What would be the best technique?

Resource   | Week1  Week2  Week3  | Total
ABC        | XYZ    10     15     20    | 45

This is the structure of the repeater with the middle section (Weeks showing hours worked by resource) being the editable nested repeater. The values can only be changed within the nested repeater. Each resource has a unique ID maintained in a hidden field.

Do you have any suggestions on how I can achieve this functionality effectively?

Answer №1

Your ORM typically handles this task, but you have the option to take care of it yourself if desired. This concept is known as 'change tracking', where the usual practice involves retrieving the data from the database, comparing it to new values, and then updating it accordingly.

Depending on your approach to concurrency, you may also consider using a hash of the initial values sent to the client, saved in a hidden field for reference. This allows you to compare the original data with what is currently stored in the database to prevent unintended overwrites of other users' modifications.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to adjust table rows to match the height of the tallest row in the table?

I've been attempting to ensure that all table rows have the same height as the tallest element, without using a fixed value. Setting the height to auto results in each row having different heights, and specifying a fixed value is not ideal because the ...

Accessing the $index value from the selected option when using ng-change within a select element

Although there are similar questions out there, I couldn't find one that addresses my specific need: ngRepeat inside option-tag ngChange inside select-tag I am trying to retrieve the index of the selected option. Here is a snippet of my code: < ...

Implementing JavaScript to assign unique IDs to several elements - a step-by-step guide

I've been struggling to find a solution to my problem despite days of research. After stumbling upon a similar Stack Overflow question (GetElementByID - Multiple IDs), I still can't seem to implement the solution into my code even after numerous ...

sending parameters to ajax method

I'm currently working on my first app and I'm having trouble passing values to an ajax function. Could someone please help me out with this? Here is the code snippet: In the HTML, there is a link that needs to pass a value, like "9": <a id= ...

Swapping out content in an HTML document using JSON data

Currently, I am developing a JavaScript script to achieve the following tasks: Retrieve and interpret data from a JSON file Access an HTML file that serves as a template Substitute elements in the HTML file with corresponding elements from the JSON file ...

Unpack an array with entries and an iterator

I am working with an array of objects, each containing the same properties. My goal is to create a function that will return an array of arrays, where each inner array holds values based on the property names of the objects. Here is an example input: inp ...

Storing video blobs in the filesystem using Electron and Node.js

My electron application allows users to record video from their webcam using the MediaRecorder API. After hitting the "stop record" button, I am able to obtain a blob of the recorded video. I am trying to figure out how to convert this blob into a real w ...

Searching for a PHPMotion equivalent in the .NET framework

While I understand that there is no .NET "Version," I am in search of an application similar to PHPMotion that is compatible with ASP.NET. Has anyone come across something like this? ...

What causes programming languages to exhibit such behavior in the absence of any established hierarchy?

I was puzzled to discover that in Python and Javascript, when using this type of conditional statement, the logic seems off. If we add console.log statements in each condition, it appears that the comparison should be false != true, meaning that the code s ...

What is the reason for the lack of impact from the toLocaleString() method?

Is it possible to utilize the toLocaleString() method in NativeScript? Take a look at this example on {N} Playground <script> export default { data() { return { trDate: new Date(1579180347000).toLocaleString( ...

Obtain JSX content from a React Component that has been imported

As part of our library documentation efforts, I am looking to convert a React Component function into JSX format. To illustrate, let's consider a rendered Button component and showcase the code used to create it. One approach could be to simply read ...

The smooth scrolling function in jQuery is producing unexpected outcomes

I'm trying to implement smooth scrolling on my website. However, the scrollbar is not working as expected. It seems like the smooth scrolling and default jumping to anchor links are happening at the same time. Here is my HTML code for the Bootstrap ...

"Despite modifying the ID in the response data of Angular MongoDB, the request data ID remains unchanged

Having trouble with managing requests and responses, specifically when a customer tries to add multiple items of the same product but in different sizes. The initial step involves checking if the ID exists by using a count and an if statement. If it exists ...

What is the method for retrieving JSON data within the AngularJS repeat directive?

I am seeking guidance on how to retrieve the main menu and sub menus separately from a JSON file using ng-repeat. Here are the relevant files: menu.json {"data": { "main menu": { "menu1": [ ...

Update annotations in a React.js powered app similar to Google Keep

I am currently working on developing a replication of the Google Keep application using react js. So far, I have successfully implemented all the basic features such as expanding the create area, adding a note, and deleting it. However, I am facing challen ...

When the user presses either the refresh button or the back button, they will be redirected

After the user presses refresh or uses the browser back button, I need to redirect them to a specific page in order to restart the application. My JavaScript code is as follows: var workIsDone = false; window.onbeforeunload = confirmBrowseAway; function ...

get a duplicate of an object

Is this the proper method for creating a duplicate of an object? class ObjectWrapper { private _obj; /*** * Copy object passed as argument to this._obj */ constructor (_obj: Object) { this._obj = _obj; } /** Return copy of this._ ...

Ternary Operator in React for Conditionally Rendering Components

I am currently working on conditionally rendering different messages on my page. Here is a simplified version of the code I'm using: <div> { isCondition1 == true ? 'Show issue list' : isCondi ...

Automate the process of making Tailwind Classes non-Global with ease!

I am currently working on an application that consists of two main parts: (X) an older AngularJs legacy application with its own set of CSS classes. (Y) a new React application contained within a div. This new part (Y) is built using webpack, postcss, and ...

Is there a way to create a self-contained installation package for my Vue application?

Is it possible for my application to be downloaded and installed without requiring internet access after the download is complete? I am looking to create a standalone installer for this purpose. Are there any suggestions on how to go about implementing t ...