Click here to Skip to main content
15,907,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a mvc application.this is my ajax code----
$(".btnrename").click(function () {
                   var check = $(".newName").val();
                   if (check != "") {
                       $.ajax({
                           url: '@Url.Action("EditUserProfile", "Home")',
                           type: "POST",
                           cache: false,
                           data: { folderName: check, parentFolderName: checkName,
                                                                  subId: checkId },
                           success: function (data) {
                               window.location.reload();
                           }
                       });
                       e.preventDefault();
                   }


i want that my page content update automaticaly without page refresh after success.

What I have tried:

i am unable to find anything to do.
Posted
Updated 18-Apr-18 20:39pm

1 solution

instead of
window.location.reload();
update the received html in inside div or other container with
$("#yourcontainer").html(receivedhtml);
in success function
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900