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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:37:48+00:00 2026-05-27T11:37:48+00:00

I’m trying to callback into my ViewResult Index() controller action from an ajax call

  • 0

I’m trying to callback into my ViewResult Index() controller action from an ajax call to update the page contents based on a dropdown select but my view is not re-updating (re-rendering).

I have set breakpoints and the index() action in the controller is being executed as invoked from the ajax ‘get’ and the model is being passed off to the view (breakpoints are being hit in the view as well).

View:

  @* Contains code to build a webgrid and display data based on the model passed in... *@
  @* Contains a couple of dropdowns for filtering *@
  @* 
     Catch the select event from a dropdown and call back into the view to re-update page contents
     for filter requests.
  *@
    <script type="text/javascript">
        $("select").multiselect({
            click: function (event, ui) {
               $.ajax(
               {   type: "GET",
                   url: '@Url.Action("Index","Data")',
                   data: { FilterRequest: (ui.checked ? 'checked' : 'unchecked') },
                   success: function () {
                   alert('hello again');
               }
             })
            }
        });
</script>

Controller:

// GET: /Data/
public ViewResult Index(string FilterRequest)
{
    IList<DataModel> dataResult;
    if (FilterRequest == null)
    {   // Not a filter request so just update grid with full contents
        dataResult = db.DataObjs.OrderByDescending(x => x.id).ToList();
    }
    else
    {   // Filter request so update grid with filtered data
        dataResult = db.DataObjs.Where(/*Build some filtered stuff here*/).OrderByDescending(x => x.id).ToList();
    }            

    // Build some sub totals based on the resultset from above result set to display
    // Other business logic number mashing here to display in other grids on the same view

    return View(dataResult);
 }
  • 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-27T11:37:49+00:00Added an answer on May 27, 2026 at 11:37 am

    You’re not doing anything with the response of the $.ajax call.

    Something like this:

    $.ajax(
    {   
       type: 'GET',
       url: '@Url.Action("Index","Data")',
       data: { FilterRequest: (ui.checked ? 'checked' : 'unchecked') },
       dataType: 'html',
       success: function (html) {
          $('#somecontainer').html(html);
       } 
    });
    

    Also, you can’t return a full view (e.g a HTML page) from your action method – you need to either return a PartialView, or a JsonResult which you can iterate over and manualy bind the contents.

    For a partial view, you need something like this:

    return PartialView(dataResult);
    

    It all depends on what your trying to re-render. If the HTML you require to re-render is complex, then use a partial view. If it’s simply a bunch of data that is to be shoved into an input element (e.g a dropdown list), you should save on the HTTP payload over the wire and use JsonResult.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

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.