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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:45:39+00:00 2026-06-11T03:45:39+00:00

I am trying to POST data to an Asp.Net Web API on another one

  • 0

I am trying to POST data to an Asp.Net Web API on another one of my domains. I need to support IE9/8 so CORS won’t cut it. When I make a call like this:

$.ajax({
type: "GET",
url: "http://www.myotherdomain.com/account",
data: "{firstName:'John', lastName:'Smith'}",
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
success: function(msg) {
    console.log(msg);
},
error: function(x, e) {
    console.log(x);
}
});​

it makes a GET request to:

http://www.myotherdomain.com/account?
    callback=jQuery18008523724081460387_1347223856707&
    {firstName:'John',%20lastName:'Smith'}&
    _=1347223856725

I’ve implemented this JSONP Formatter for ASP.NET Web API and my server responds with a properly formatted JSONP response. I don’t understand how to register a route to consume an account object.

config.Routes.MapHttpRoute(
    name: "Account",
    routeTemplate: "account",
    defaults: new { controller = "account", account = RouteParameter.Optional }
);

How do I deserialize an object from a querystring parameter without name?

  • 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-11T03:45:40+00:00Added an answer on June 11, 2026 at 3:45 am

    Instead of using JSON you could send the parameters as query string values. Let’s suppose that you have the following model:

    public class User
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
    

    and the following API controller:

    public class AccountController : ApiController
    {
        public HttpResponseMessage Get([FromUri]User user)
        {
            return Request.CreateResponse(HttpStatusCode.OK, new { foo = "bar" });
        }
    }
    

    which could be consumed like that:

    $.ajax({
        type: 'GET',
        url: 'http://www.myotherdomain.com/account?callback=?',
        data: { firstName: 'John', lastName: 'Smith' },
        dataType: 'jsonp',
        success: function (msg) {
            console.log(msg);
        },
        error: function (x, e) {
            console.log(x);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use jquery.Ajax to post data to an ASP.NET MVC2 action method
I have an ASP.Net MVC application. I am trying to post data to an
I am trying to post some data to a ASP.NET MVC Controller Action. Current
I am trying to post an image to facebook grap api using asp.net ,
I need to perform asp.net web-service function call via jQuery and pass asp.net application
I am trying to use a web service built on asp.net wcf from iPhone
I am trying to return an html table from a asp.net web service but
I'm trying to pass an array of string parameters to a C# ASP.NET web
Here's the scenario: ASP.NET MVC2 Web Application Entity Framework 4 (Pure POCO's, Custom Data
Consider an ASP.NET Web API service that redirects public class ThisController : ApiController {

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.