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

  • Home
  • SEARCH
  • 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 6771107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:23:34+00:00 2026-05-26T15:23:34+00:00

Sending objects to ASP.NET from JSON works fine if you have a class built

  • 0

Sending objects to ASP.NET from JSON works fine if you have a class built that matches the JSON object, but all I need to do is send a single integer.

var request = { "int": jQuery('select#propSelect').val() }

            jQuery.ajax({
                url: '/Property/getPropByID',
                type: 'POST',
                data: JSON.stringify(request),
                dataType: 'json',
                contentType: 'application/json',
                success: on_request_success,
                error: on_request_error
            });

Does anybody know how to do this?

Once it gets to the server I try to print out what has been passed and it displays nothing.

    public void getPropByID(string objects)
    {
        System.Diagnostics.Debug.WriteLine("JSON> "+ objects);
        //return js.Serialize(db.Properties.Find(id));
    }
  • 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-26T15:23:35+00:00Added an answer on May 26, 2026 at 3:23 pm

    If all you need to do is send an int, then do this:

            jQuery.ajax({
                url: '/Property/getPropByID',
                type: 'POST',
                data: {'myint':$('select#propSelect').val()},
                dataType: 'json',
                contentType: 'application/json',
                success: on_request_success,
                error: on_request_error
            });
    

    And on the web service side:

    public void getPropByID(int myint)
    {
    
    }
    

    Note: I believe the parameter name on your web service must match the parameter name on the client side.

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

Sidebar

Related Questions

sending mail along with embedded image using asp.net I have already used following but
I have an application that is sending a JSON object (formatted with Prototype) to
I have an ASP.NET MVC (using the release candidate) application that works with a
I am trying to receive a json object back from php after sending data
I am unable to convert JSON string to .net object in asp.net. I am
I have been happy serializing with javascript objects into JSON using JSON.stringify And sending
Can anyone recommend an article on sending and receiving JSON to an asp.net web
I am sending mail using classic ASP with the CDOSYS objects, but I would
I have an ASP.NET MVC 3 website that communicates with my iOS app via
I'm sending files from an android app to a asp.net webform using multipart/form-data as

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.