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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:55:09+00:00 2026-05-29T17:55:09+00:00

I have a web page that is using JQuery to communicate with the backend.

  • 0

I have a web page that is using JQuery to communicate with the backend. I have some POST actions. However, I now have a GET action and I’ve noticed that the parameter values passed to it are null. My POST actions work just fine. I can’t figure out why.

From my .html file, I have the following JQuery query:

var vm = { emailAddress:"someone@somewhere.com" };
$.ajax({
  url: "/myService/myAction",
  type: "GET",
  data: JSON.stringify(vm),
  contentType: "application/json",
  success: myAction_Succeeded,
  error: myAction_Failed
});

In my controller, I have:

public class MyServiceController : Controller
{
  [AcceptVerbs(HttpVerbs.Get)]
  public ActionResult MyAction(string emailAddress)
  {
    return Json(new { address:emailAddress });
  }
}

My route is setup as follows:

context.MapRoute(
  "MyAction",
  "myService/{controller}/MyAction",
  new { controller = "MyService", action = "MyAction" }
);

I have a hunch that I’m missing something in my route. But I’m not sure what it is. I followed the same syntax I used with my POST actions. Parameters with those actions work just fine. But the parameters with my GET actions, like the one above, have null values. My question is, what am I doing wrong and what if I need to pass multiple parameters?

Thank you so much for your help!

  • 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-29T17:55:14+00:00Added an answer on May 29, 2026 at 5:55 pm

    The JsonValueProviderFactory that allows you to send JSON requests to controller actions in ASP.NET MVC 3 works with POST requests. For GET requests you could use a standard request:

    var vm = { emailAddress:"someone@somewhere.com" };
    $.ajax({
        url: "/myService/myAction",
        type: "GET",
        data: vm,
        success: myAction_Succeeded,
        error: myAction_Failed
    });
    

    Or if you want to send JSON requests modify type: 'POST' in your AJAX request. Obviously in this case you will have to remove the HttpVerbs.Get attribute from your controller action which currently constrains it to only GET requests.

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

Sidebar

Related Questions

I am working on a web page that is using jQuery. I have an
I have web page with some really large tables that I'm filtering using some
I have created a web page using JQuery Mobile that has a link at
I have a web page that is being displaying in a winform app using
Today we have a windows application that, using an OCX, creates a web page
I'm using Spring Web Flow (v. 1.0.5) and I have a JSP page that
I have made a Web page using jquery and php where all files are
I have an aspx page that makes an Ajax request (using jquery) to a
I have a Page that expects a POST Request and returns some JSON. Essentially
I have written some code using jQuery to use Ajax to get data from

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.