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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:15:22+00:00 2026-06-15T04:15:22+00:00

Does anybody have a list of reasons why a browser would ask to save

  • 0

Does anybody have a list of reasons why a browser would ask to save a file of JSON data instead of using it to update the page according to functions already present? I had this working for a while, but all of a sudden, I did something that caused that to not work anymore. I am using asp.net MVC4.

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>

As you see I have included the appropriate scripts.

@using (Ajax.BeginForm("SearchByDemographic", "SearchPatients", null, new AjaxOptions { HttpMethod = "POST", LoadingElementId = Url.Content("~/Images/ajax-loader.gif"), OnSuccess = "binddata", OnFailure = "FailAlert" }, new { id = "searchByDemographics" }))

I use Ajax.BeginForm() as you can see.

Here is the function that I use to return the JSON result

    [HttpPost]
    public ActionResult SearchByDemographic(SearchByDemographicModel SearchByDemo)
    {
        string UID = HttpContext.User.Identity.Name;
        DataRepository dr = new DataRepository();
        List<SelectListItem> retVal = dr.SearchByDemographic(SearchByDemo, UID);
        if ((retVal == null) || (retVal.Count < 1))
            return Json("Empty Record: No Patient Found", JsonRequestBehavior.AllowGet);
        else
            if(retVal[0].Text.Contains("Error")){
                return Json(new {success = false, nameError = "General Return Exception"}, DataRepository.searchPatientJSonStr(retVal), JsonRequestBehavior.AllowGet);
            }
            else{
                return Json(DataRepository.searchPatientJSonStr(retVal), JsonRequestBehavior.AllowGet);
            }//return PartialView("_RetTable", Json(DataRepository.searchPatientJSonStr(retVal), JsonRequestBehavior.AllowGet));            
    }

This keeps happening to me. I am ignorant of the reasons why this could happen. If I could figure out why this keeps happening I would be in a better position to fix it in the future.

From my knowledge, The browser is expecting JSON data, and somehow or the other, it is not getting it?
Also, Here is JSON of test data being passed back… If it is a little off forgive me, I tried to get a single result out of a list of 20…

"{\"total\":1,\"page\":1,\"records\":1,\"rows\":[{\"id\":11248971,\"cell\":[\"CRAYON \",\" RED \",\" 1956-03-04 \",\" M \",\" 11248971 \",\" 840006723 \",\" 737452545\"]}]}

I do load unobtrusive-ajax

I still always just get a prompt to open the file.

My Return Type

  • 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-15T04:15:23+00:00Added an answer on June 15, 2026 at 4:15 am

    This behaviour is only present in IE due to a configuration option named “Show friendly JSON errrors” which makes ie ask to save your json if it’s smaller than a certain size ( i seem to remember 200 characters) instead of consuming it normally

    A possible solution is to use

    return Json(result, "text/html");
    

    which will make IE behave correctly

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

Sidebar

Related Questions

Does anybody know of or have a detailed list of how the BCL in
does anybody have any experience writing up a offline data storage & access app
Does anybody have a solution to why I would be saving nulls to a
Does anybody have any example code on how this would work? Seems like it
Does anybody have a list of programming languages as a table ( sql )
Does anybody have a script for inserting a list of UK towns cities into
Does anybody have experience build app with PhoneGap's Build Service? I followed the steps
Does anybody have any experience with as3-spod? I downloaded the source code from github
Does anybody have a good analogy (or, failing that, a good resource) for describing
does anybody have any idea what's does this mean: onLoad=MyOnLoad? thanks

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.