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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:10:29+00:00 2026-06-12T14:10:29+00:00

I asked a question yesterday where it was closed with duplication reason, However I

  • 0

I asked a question yesterday where it was closed with duplication reason,
However I still did not get an answer how to resolve my issue and i need some assistance.

I am using ASP.NET with script manager

<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" EnablePartialRendering="true" runat="server" />

I am getting error 500 when trying to post data to server.

Bad code with Error 500:

CS:

[WebMethod]
public static void SetCurrentBaseVersion(string id)
{
    // need to get here
}

JS:

function postNewBaseLine() {
    var id = "300";

    $.ajax({
        type: "POST",
        url: "ManagerBaseKit.aspx/SetCurrentBaseVersion",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        data: {'id' :id},
        success: function (data) {
            alert('success!');
        },
        statusCode: {
            500: function () {
                alert('got error 500');
            }
        }
    });
}

What I found so far that if I remove the string id in the webmethod it is working fine and I am being able to reach the SetCurrentBaseVersion (not getting error 500)

Working Code:

CS

[WebMethod]
public static void SetCurrentBaseVersion() //removed the string id
{
    // need to get here
}

JS

function postNewBaseLine(id) {
    var id = "300";

    $.ajax({
        type: "POST",
        url: "ManagerBaseKit.aspx/SetCurrentBaseVersion",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        //data: {'id' :id},   removed the data
        success: function (data) {
            alert('success!');
        },
        statusCode: {
            500: function () {
                alert('got error 500');
            }
        }
    });
}
  • 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-12T14:10:30+00:00Added an answer on June 12, 2026 at 2:10 pm

    You have to pass data as a json string you need to put the value of data in double quotes to make it string. The json format has key value pair within quotes. You need to understand Json Data Format

      data: "{'id': '" + id+ "'}",
    

    This also worked without using quotes around key and value but json document which I referred states for putting quotes around key and value.

      data: "{id: " + id + "}",
    

    For method having two parameters,

    Code behind

    [WebMethod()]
    public static string CallMethodFromClient(string id, int amount)
    { 
    

    HTML

        data: "{ id : " + id + ", amount : " + amount + " }"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked my question yesterday but could not get a correct answer. now ill
I asked the same question yesterday and the answer was not applicable. https://stackoverflow.com/questions/6194578/breaking-up-class-functions-into-multiple-cpp-files If
So I asked something similar yesterday and did receive an answer to my question,
Hi I have asked this question yesterday and was closed of being not understood,
I asked a question yesterday which got answers but didnt answer the main point.
I asked a similar question yesterday, but recognize that i need to rephase it
I have a issue with my java code. i asked the same question yesterday.
I asked a question about bigints yesterday which was kindly answered. However, I have
As an answer to a question I asked yesterday ( New Core Data entity
I asked this question yesterday and it turned out to be a Maven issue.

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.