Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Update a value / item without updating a page

$
0
0

Hi,

Can someone help me with an example of updating an item or value without updating the full page? everything I find is related to pages.


My problem is as follows I have a project in asp.net mvc that performs a listing when someone edits the listing I keep the current time that the record was modified, so far everything was perfect, but for the value to be displayed I am loading the complete page.

 @foreach (var item4 in item2.status)
                                {@item4.Data_mod
                                }

I currently have the function below to update the value in the database

$("#ordertable").on("click", ".Editbtn", function () {
                var status = new Object();
                //more code
                status.Data_mod = $(this).closest('tr').find(".Data_mod").val();
                if (status != null) {$.ajax({
                        type: "POST",
                        url: "/Home/EditPost",
                        data: JSON.stringify(status),
                        contentType: "application/json; charset=utf-8",
                        dataType: "json", 
                    });
                }location.reload();

as you see in the end i'm using a location.reload();

my question is how can i only update @item4.Data_mod by pressing the button "Editar".

Thanks for any help!


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>