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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:06:04+00:00 2026-06-16T01:06:04+00:00

This is my web service [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public Dictionary<string,List<string>> GetCategorias() { var

  • 0

This is my web service

[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public Dictionary<string,List<string>> GetCategorias()
{
    var diccionario = new Dictionary<string, List<string>>();
    var categoria = "Recursos Humanos";
    diccionario.Add(categoria,new List<string>());
    diccionario[categoria].Add("Busqueda de recursos");
    diccionario[categoria].Add("Busqueda de recursos humanos");

    var categoria1 = "Informatica";
    diccionario.Add(categoria1, new List<string>());
    diccionario[categoria1].Add("IT");
    diccionario[categoria1].Add("Departamento de Insfractructura");

    //var serializer = new JavaScriptSerializer();
    //string json = serializer.Serialize((object)diccionario);

    return diccionario;
}

I received the dictionary in Javascript as:

 function get_Categorias_Comunidades() {
        $.ajax({
            type: "POST",
            url: "Lista_Categoria_comunidad.asmx/GetCategorias",
            data: "{}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: llamada_Webservice,
            error: llamada_Error
        });
    }
    function llamada_Webservice(peticion) {
        debugger;

    }

How do I parse the keys and values to an array?

  • 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-16T01:06:06+00:00Added an answer on June 16, 2026 at 1:06 am

    Something like this

    function llamada_Webservice(peticion) {
    var categories = peticion;
        for(item in categories{ // Data is saved in the variable named d if it's ASP.NET WebService
            var categoria = item; // The name
            var list = categories[item]; // The array that you could loop thru
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple .NET [asmx] web service setup like this: [WebMethod] [ScriptMethod(ResponseFormat =
useing asp.net webservice with method : [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public List<MyObject>
This is my WebMethod <WebMethod(Description:=Fetch Nested Albums, EnableSession:=True)> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _ Public Function moveImages()
I have a datatable in my web service it goes like this [WebMethod] [ScriptMethod]
I have the following web service method (.ASMX file): [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat =
I have a web method like this as part of a web service public
Why does this simple web service refuse to return JSON to the client? Here
In my asmx file, I have [WebMethod] [ScriptMethod] public void Method(IDictionary<string, CustomClass> objectOfCustomClass) {
I have created a webservice in C# which looks like this: [WebMethod] [ScriptMethod(ResponseFormat =
I have this web service : using System.Web.Services; namespace Contracts { [WebService(Namespace = http://tempuri.org/)]

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.