Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9319837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:29:01+00:00 2026-06-19T03:29:01+00:00

I added a new client using JQuery dialog and on success I want to

  • 0

I added a new client using JQuery dialog and on success I want to reload the page but not happening.

JQuery call

 $("#saveNewClient").click(function () 
        {
            if ($(this).valid())
            {
                var clientName = null;
                var clientTypeId = null;
                var clientCode = null;

                clientName = $('#Client_ClientName').val();
                clientTypeId = $('#ClientTypeSelectId').val();
                clientCode = $('#Client_ClientCode').val();

                $.ajax(
                    {
                        type: "POST",
                        async: false,
                        url: "/Client/AddClient",
                        cache: false,
                        data: { "clientName": clientName, "clientTypeId": clientTypeId, "clientCode": clientCode },
                        dataType: "json",
                        error: function (request) {
                            alert(request.responseText);
                        },
                        success: function (result) {
                            //alert('Successfully Inserted Client');
                            $.ajax({
                                url: "/Client/Index",
                                type: 'GET',
                                datatype: 'json',
                                success: function (data) {
                                    //alert('got here with data');
                                },
                                error: function () {
                                    //alert('something bad happened');
                                }
                            });
                            $('#myClientDialogContainer').dialog('close');
                        }
                    });
            }
            return false;
        });

Earlier I given an alert message “Successfully added client”. But as the client added is not appearing in the grid. I called another ajax call to refresh the page with the data. The action method is calling and when the page loads I can see the the added client data is passing to Grid, but the grid is not appearing with the newly inserted client. When I refresh the page the row is appearing. Please can anyone help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:29:02+00:00Added an answer on June 19, 2026 at 3:29 am

    Make sure that in your success callback you refresh your DOM:

    success: function (data) {
        //alert('got here with data');
        $('#yourGridContainer').html(data);
    }
    

    This obviously assumes that the Index controller action is returning a partial view containing the grid with the updated results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added a new client-side JS lib (typeAheadDemo.js) to my theme recently, but the
I added a new file F1 and made changes to another file F2 but
I have a jQuery script running that makes a periodic AJAX call using the
I can successfully post an array to PHP using Ajax Post but I want
I have created a TCP client using Apache Mina. I have added a while
I have IIS 7.5 With one web site I added new virtual directory and
My storyboard seems locked. I have added new labels and imageviews to two different
I removed my .gitconfig by accident. I added new identies by git add [file]
This is my xml now. There can be added new item nodes and I
I added a new value (NULL_IS_NOT_NIL) to an enum in ksql.h enum { PKEY

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.