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 5950005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:19:55+00:00 2026-05-22T17:19:55+00:00

I am developing a website using ASP.NET MVC 3. I have a number of

  • 0

I am developing a website using ASP.NET MVC 3.

I have a number of sections containing news from different departments, as shown in the picture below:

https://i.stack.imgur.com/G21qi.png

The sections are added to the masterpage by using

@Html.Action("_News", "Home", new { id = 1 })

Where id 1 = “Ledelsen”, 2 = “Omstillingen” and so on.

My Controller contains the following Action:

[ChildActionOnly]
public ActionResult _News(int id)
{
    // controller logic to fetch correct data from database
    return PartialView();
}

I got CRUD up and running, but my question is how I can refresh the PartialViews without postback, at a set interval?

I’m guessing I have to use Javascript/jQuery to accomplish this, but I have not been able to.

Can anyone point me in the right direction or better yet, provide an example of how to do this?

Thanks in advance

EDIT: Just to clarify I do not want the whole page to refresh, but only do an asynchronous refresh of the partialviews

  • 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-05-22T17:19:56+00:00Added an answer on May 22, 2026 at 5:19 pm

    In your partial view, I’d suggest wrapping the whole thing in a div:

    <div id="partial1">
    

    In javascript you’ll need a function to use AJAX to load the partial view into the div:

    $("#partial1").load("_News", { id="1"} );
    

    That’s using jQuery. Some documentation here. Basically, that will replace the div indicated with view generated from the call to your _News action. The id can be varied if you add some logic to the javascript call.

    Then wrap the call to load() in a setTimeout():

    var t = setTimeout(function () {$("#partial1").load("_News", { id="1"} );}, 60000);
    

    That will run the included function every 60 seconds. t can be used, thusly clearTimeout(t) anywhere in your javascript code to stop the auto refreshing.

    EDIT

    This should address the caching issue. Thanks @iko for the suggestion. I’ve noticed you need cache: false for this to work.

    var t = setTimeout(function () { $.ajax({ 
                                         url: "_News", 
                                         data: { "id": "1" }, 
                                         type: "POST", 
                                         cache: false, 
                                         success: function (data) { 
                                              $("#partial1").innerHTML = data; 
                                         }}); }, 60000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a website (using asp.net-mvc) with a SqlServer 2005 database. I have numerous
I'm developing a website in ASP .NET MVC 2 using C#. I have a
I've been developing a simple website using asp.net MVC and I'm starting to add
I'm developing an website using asp.net mvc with MySQL and I need to make
I am developing a website using ASP.Net MVC 1.0. Can i host that website
I'm developing a website using ASP.NET MVC. The website should handle multiple languages. I
I am developing a website using Asp.Net MVC framework. We need to add general
I am developing a website in ASP.NET MVC, using the latest IE and Chrome
i am developing a website using asp.net 3.5.i have created a cascading dropdownlist for
I'm developing a website using asp.net mvc 2.0 . I'm using LINQ to SQL

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.