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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:47:55+00:00 2026-06-16T04:47:55+00:00

I have a ajax call that goes like this.GetTransactionsInputToday = function () { var

  • 0

I have a ajax call that goes like

this.GetTransactionsInputToday = function () {
             var status="complete"
             $.ajax({
                 url: '/Management/function1',
                 contentType: "application/json; charset=utf-8",
                 data: status,
                 type: 'GET',
                 cache: false,
                 success: function (result) {
                     return result;
                 }
             });
         }

I have also tried doing like this

this.GetTransactionsInputToday = function () {
             var status="complete"; 
              $.ajax({
                     url: '/Management/function1/' + status,
                     type: 'GET',
                     cache: false,
                     success: function (result) {
                         return result;
                     }
                 });
             }

I have a controller function in my management controller class

public JsonResult function1(string status)
{
Some code here.. 
}

The issue is that every time function1 is called teh value of status comes as null.
CAn any one please let me know where am I going wrong??

  • 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-16T04:47:56+00:00Added an answer on June 16, 2026 at 4:47 am

    You need to define name for the data you sending data: {'status': status}:

    this.GetTransactionsInputToday = function () {
        var status="complete"
        var r = '';
    
        $.ajax({
            url: '/Management/function1',
            contentType: "application/json; charset=utf-8",
            data: {'status': status},
            type: 'GET',
            cache: false,
            success: function (result) {
                r = result;
            }
        });
    
        return r;
    };
    

    Also your this.GetTransactionsInputToday will not return result as you expected. The success handler of ajax function gets called asynchronously. So your return r statement will return ” as it gets called before the Ajax request gets completed.

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

Sidebar

Related Questions

I have a function for an ajax post call that goes like this: function
So I have this long function in jquery that includes a jquery ajax call,
I have an ajax call that fires multiple times but is called once. function
A situation I ran across this week: we have a jQuery Ajax call that
I have a web service that returns this string via the jQuery $.ajax() call
I have the following ajax call: $(#welcome a.close).click(function(e) { $.ajax({ type: GET, url: /visitors/hide_welcome,
I have an ajax call to a php script that goes into a database
I have a jQuery ajax call that returns html of a table. Now I
I have a jQuery AJAX call that I will need to do multiple times
I have an $.ajax call that includes both a success and error condition: $('input[name=StateName]').live('change',

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.