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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:40:22+00:00 2026-05-13T05:40:22+00:00

I am using a jQuery Ajax control from this site http://abeautifulsite.net/2008/03/jquery-file-tree/ I have it

  • 0

I am using a jQuery Ajax control from this site http://abeautifulsite.net/2008/03/jquery-file-tree/

I have it all working. I tried to ask a support question but never heard back, thinking maybe someone on here can shed some light on the situation.

Basically what I am trying to do, is on a file selection run an action that returns a JsonResult, that gives more details about the file and then show them to the screen in a container. While I debug, the method gets hit, returns the correct data. After the return in the ajax call i get a error in firebug say the recursionlimit exceeded. I am not sure how to get around this…I thought I could use the callback of the fileTree(options, callback) method provided but that is not fired on selection of the file only the initialization of the file tree. Any ideas?

Heres what I did via JavaScript

function initFileTree() {

    $('#fileTree').fileTree({ root: '/', script: '/Scripts/filetree/jqueryFileTree.aspx', multiFolder: false, expandEasing: 'easeOutBounce', collapseEasing: 'easeOutBounce' }, function(file) {

        getFileDetails(file);

    });

}

function getFileDetails(file) {

    // alert(file);

    $.getJSON('/Files.mvc/GetFileDetails', { Data: file }, function(data) {
        $('#fileDetail').html('<h6>Selected File: ' + data.Length + '</h6>');
    }, 'json');
}

Here is my action that take the data and returns a JsonResult

public virtual JsonResult GetFileDetails(string data)
        {
            string pageMessage = null;

            FileInfo fileInfo = null;

            try
            {
                fileInfo = new FileInfo(data);
            }
            catch (Exception e)
            {
                pageMessage = e.Message;    
            }

            return Json(fileInfo);
        }
  • 1 1 Answer
  • 1 View
  • 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-13T05:40:22+00:00Added an answer on May 13, 2026 at 5:40 am

    Apparently returning a FileInfo obj is not acceptable for a JsonResult. Simplifying the return, I changed it to:

    return Json("helloWorld"); 
    

    and all my problems went away. Not sure why it cares that I was attempting to return a FileInfo type but either way problem solved when I changed it to return a string. So now I just create a small wrapper class to hold the data I want to pass back and life is good.

    Thanks! Hope this helps someone else.

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

Sidebar

Related Questions

I have an Ajax control that is loaded into a Yahoo popup using jQuery.
I'm trying to do an XMLHttpRequest from a local file (file://) using JQuery.ajax to
I am making an AJAX call using jQuery to an .ascx control's method in
How to pass multiple checkboxes using jQuery ajax post this is the ajax function
So I have a system using jQuery AJAX to load the content dynamically. I
How would you access the cache from a jQuery ajax call? I'm using jquery
I have some content that I am loading using jquery ajax. The content has
I am using JQuery within a custom AJAX user control (part of a home
I've been injecting this jQuery code from the code behind of a .net user
I've got a web service (ASP.NET 2.0) that I'm calling from javascript using jQuery's

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.