ajax c# reload in jquery

ITsolutionWizard
ITsolutionWizard used Ask the Experts™
on
After the ajax post is success, how can i reload html div id = resultlist?
This ajax call is to add a record into the database.

<script>
                                   function AddNew(fleetid, feeDescription, priceType, cost)
                                   {
                                       $.ajax({
                                           url: "/Home/AddFeePrice",
                                           datatype: "json",
                                           data:
                                           {
                                               'feedescription': document.getElementById(feeDescription).value,
                                               'pricetype': document.getElementById(priceType).value,
                                               'cost': document.getElementById(cost).value,
                                               'stage': 'Active',
                                               'fleetId': document.getElementById(fleetid).value
                                           },
                                           type: "POST",
                                           success: function (data) {
                                               var result = data.updateFeeStatus;
                                               alert("Success " + result);
                                            },
                                           error: function (error) {
                                               alert("Error " + error);
                                           }
                                       });
                                   }
                        </script>



<html>
<div id="resultlist">
Hello!
</div>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Software Engineer
Distinguished Expert 2018
Commented:
How about
$("#resultlist").load(" #resultlist");

Open in new window

some thing like that
Zakaria AcharkiAnalyst Developer
Distinguished Expert 2018

Commented:
Hi, could you please tell us what you want exactly to show in the "resultlist"? if you want a list after the add action, do you receive the updated data back I the callback or you want to perform another request to get the updated data?
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
What do you want to show in the div?

If it is the result of the AJAX call then simply do this (line 18 of your script change to)

$('#resultlist').html(result);

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial