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

  • Home
  • SEARCH
  • 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 7780469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:54:29+00:00 2026-06-01T18:54:29+00:00

I need help with this.. I have a viewdata with a list of clients

  • 0

I need help with this..

I have a viewdata with a list of clients and i feed it when the Index action method is called.

/* Index action is the method that open the view. */

Once that the Index method was called, the variable is feeded and view is showed.

Then, i have a dialog where is render a partialView, wich have a table with the list of clients.

<div id="popupClients" class="popUp" style= "display:none">
    <% Html.RenderPartial("ClientsPartialView", ViewData["clients"]); %>

/* popupClients is the dialog. */

/* ClientsPartialView is a partialView with a table that show id and name of clients. */

The cuestion is how i can refresh the data of the viewdata before being displayed?

I ask this because, if someone insert a new client, has to be displayed in the partialView

Thnxs!

  • 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-01T18:54:31+00:00Added an answer on June 1, 2026 at 6:54 pm

    You can use Ajax to refresh the portion of your page that represents the popupClients just prior to showing that dialog.

    If your partial view renders, say, a div containing all of the content for the popup, you can use Ajax to refresh that div, something along the lines of:

    function getCustomerList(searchCriteria) {
        $.ajax({
            url: 'Home/GetClientList',
            type: 'POST',
            async: false,
            data: { searchString: searchCriteria },
            success: function (result) {
                $("#popupClients").html(result);
                $( /*... do whatever you do now to show your dialog....*/ ;
            }
        });
    };
    

    UPDATE

    Based on your comment…

    Every time your server-side code runs (and you just showed me server-side code in your comment), you are in a position to get fresh data.  When your partial view calls back to your controller, your controller should update the Model from the database if that is the business requirement.

    Something along the lines of:

    [OutputCache(Duration = 0)]
    public ActionResult _ClientList()
    {
        List<Clients> clientList = GetCurrentClientListsFromDB();
    
        return PartialView(clientList);
    }
    

    That will cause a check to the database every time the controller is invoked. If it’s acceptable to miss a recent update, you can change the value of OutputCache to inform the MVC engine to cache the result for a given number of seconds. You can also configure the OutputCache to refresh based a SQL Dependency so that it is automatically invalidated when there is a change to an underlying table rather than just refreshing based on elapsed time. That’s more complex to setup, but will give a more accurate result.

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

Sidebar

Related Questions

I have this JUnit test that I need help developing a Interface and Class
I really need help here. I'm desperate at this point. I have NSOperation that
I need help with this. I have a database that displays product type titles.
I need help on this thing. I have 3 view controllers say Parent and
Hey guys I need some help with this: I have two view controllers, let's
I really need some help with this as I have been trying to fix
i have this code, and need help with the logic end. I would like
i need help with disk_total_space function.. i have this on my code <?php $sql=select
I'm not good at t-sql, so I need help. I have this code I
I need some help with a LINQ query in VB.Net, please. I have this

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.