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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:53:46+00:00 2026-05-26T09:53:46+00:00

my problem is following. I try to parse some data via ajax, passing the

  • 0

my problem is following.
I try to parse some data via ajax, passing the data to my controller:

AJAX

$.ajax({
            type: "GET",
            url: "ParseOrganizaitonPath",
            data: {
                organizationPath: $('#organizationPath').val()
            },
            success:
                    function (data) {
                         //data is from type string with value "System.string[]" 
                         //but should be from type System.string[] 
                        });
                    }
        });

Controller

public string[] ParseOrganizaitonPath(string organizationPath)
{
    List<string> organizations = organizationPath.Split('/').ToList();

    return organizations.ToArray();
}

I am reaching the controller method and in it everything is fine, but the data that is comming back (ajax part, success method) is just a string (“System.string[]”, data[0] S, data[1]y data[2]s…) but not the data I want. (For example if i pass the input “test/one” I want to have as result data[0] test, data[1] one)

Hope you understand what my Problem is.

Thanks in advance!

Julian

  • 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-26T09:53:47+00:00Added an answer on May 26, 2026 at 9:53 am

    Have to tried to use the JavaScriptSerializer? Have a look at this example:

    public string ParseOrganizaitonPath(string organizationPath)
    {
        List<string> organizations = organizationPath.Split('/').ToList();
        System.Web.Script.Serialization.JavaScriptSerializer oSerializer = 
                 new System.Web.Script.Serialization.JavaScriptSerializer();
        return oSerializer.Serialize(organizations);
    }
    

    To deserialize the JSON string with JavaScript you can use the parse function:

    var array = JSON.parse(data);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing some URL links with the following.. Document jsDoc2 = null; try
I'm having a problem with TRY...CATCH blocks. Can someone explain why the following code
I got a little problem. Sometimes, when I try to call the following code,
I have the following problem. I have an object with some DateTime properties ,
I'm having the following problem in python. I need to do some calculations in
The following code for some reason poradically works. I have checked the URL so
I get the following error when I try to run my java program(it's supposed
I have a problem following from my previous problem . I also have the
Following problem: I want to render a news stream of short messages based on
The following problem happens on both Safari and Chrome, so probably a WebKit issue.

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.