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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:54:05+00:00 2026-06-03T06:54:05+00:00

I have a ASP.NET MVC3 application that gets a List of Coordinates from a

  • 0

I have a ASP.NET MVC3 application that gets a List of Coordinates from a WCF service. This service returns a List with a few properties (Xcoor and Ycoor).

   public List<Location> GetCoordinate()
        {
            sensor = new Location();

            List<Location> coordinateList = sensor.GetSensorInformation();

            return coordinateList;

        }

In my web Page, I have a JavaScript function that takes 2 parameters and displays coordinates on the page (on a map)

function GetLocation(y, x){
//my code here
}

I want to get the list of coordiates from my controller and pass them in to that JS function for processing.

What is the best way to go about this?

I tries using the following but I dont know how to parse the results

 $.ajax({
            url: '@Url.Action("GetCoordinate")',
            type: 'GET',
             dataType: 'xml',
            success: function(result) {

            },
            error: function (xhr, ajaxOptions, thrownError){
                    alert(xhr.status);
                    alert(thrownError);}
        });

Any ideas?

  • 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-03T06:54:07+00:00Added an answer on June 3, 2026 at 6:54 am

    Change your controller to the following:

    public ActionResult GetCoordinate()
    {
        sensor = new Location();
    
        List<Location> coordinateList = sensor.GetSensorInformation();
    
        return Json(coordinateList, JsonRequestBehavior.AllowGet);
    
     }
    

    Now your controller action is returning JSON which jQuery can process.

    Change your jQuery method to do this:

    $.ajax({
        url: '@Url.Action("GetCoordinate")',
        type: 'GET',
        dataType: 'json',
        success: function(data) {
            // process the data coming back
            $.each(data, function(index, item) {
                alert(item);
            });
        },
        error: function (xhr, ajaxOptions, thrownError) {
            alert(xhr.status);
            alert(thrownError);
        }
    });
    

    Now your AJAX method knows it is dealing with JSON data. You can use the jQuery each method to do something with the data (I am just doing an alert in this case).

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

Sidebar

Related Questions

In an ASP.NET MVC3 application I have an Action method that returns a file
I have a ASP.NET MVC3 application that handles time-consuming processes (copying a large file
This is about asp.net mvc3 web application. We have used Object cache to store
Well, this is an interesting problem. I have an ASP.NET MVC3 Intranet application running
I have an asp.net MVC3 application that makes Ajax calls to the server on
I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
I am researching security frameworks for an ASP.NET MVC3 application that would have some
In an ASP.NET MVC3 application I have a function that looks like: Public Sub
In my ASP.NET MVC3 application I have the following method that use EF entities
I have to develop an ASP.NET MVC3 application in C# and Razor that has

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.