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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:21:29+00:00 2026-06-11T21:21:29+00:00

I have a controller action which is getting called by JQuery ajax, and hopefully

  • 0

I have a controller action which is getting called by JQuery ajax, and hopefully returniung the contents of “Results” to the requesting page.
So far I have…

Controller

    public ActionResult DynCalc(resultsModel model){
    ...
    //code that populates model - all working ok
    ...
     if (Request.IsAjaxRequest())
          {
            return PartialView("results", model.Results);
          }
          else
          {
            return null; //Handle this later
          }
    }

This passes back a valid model.
Called from the javascript:

     $.ajax({
            url: "/Test/DynCalc",
            type: "POST",
            data: $("#frmResults").serialize(), //This part works
            dataType: "html",
            success: function (result) {
                $('#resultsSection').html(result);
                $('#hide_panel a').flash("#111", 1000);
            }
        });

Sucess is never hit. Hopefully somebody can just tell me i’m being daft and missing something obvious?

My partial view results is just a HTML page with javascript on it. If I just have the following

Hello world in my results view, then it works ok, with any script in, it doesn’t

Am I on the right track? Should I be changing the type of return on the controller? Or using JSON?

I didn’t post the contents of the results page, as It doesn’t matter if it’s a whole document or simply <b>hi</b> – it does the same thing.

  • 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-11T21:21:31+00:00Added an answer on June 11, 2026 at 9:21 pm

    Try to return just a View. Because your result in this case is a complete View (because the action result could be HTML, XML, JSON…whatever).
    Use PartialView only as a way to render part of your View.

    E.g. on your MasterPage you would like to “always” render user info: @RenderAction("UserInfoAction", "UserController")

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

Sidebar

Related Questions

I have a jQuery post submitting a form to a controller create action, which
I have controller users . In this controller I have action account which is
I have a javascript function from which I need to call a controller action
I have an url domain.com/a which redirects to domain.com/controller/action/a . How do I get
I have a form which users must fill out and submit. The controller action
i have a controller named PagesController which used to have an action named contest
I have a controller named Content, which has an Index action, which is associated
I have a model which throws a XMLDocument_Exception. In my controller action I want
I have two actions in my controller which are sharing part of logic responsible
I have an action in one of my controllers which creates a downloadable zip

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.