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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:15:57+00:00 2026-05-25T06:15:57+00:00

Before adding any parameters I had this POST method hitting my serverside code whenever

  • 0

Before adding any parameters I had this POST method hitting my serverside code whenever a user would set focus from one control to another. This was good but i need to pass data of the id and value. These values are being populated from what gather in my failure growl.

The issue is that I don’t exactly know why it will no longer hit my serverside routine. I did look around stackoverflow a good deal for some help, i did clean up a few things but I couldnt quite pinpoint exactly where my issue is.

$(document).ready(function () {
    var id;
    var value;

    $(".tpControl").blur(function () {

        id = this.id;
        value = $(this).val();

        var postdata = { identifier: id, controltext: value };

        $.ajax({
            type: "POST",
            url: "TimePoints.aspx/ClientSideSave",
            contentType: "application/json; charset=utf-8",
            data: postdata,
            dataType: "json",
            success: function (msg) {
                if (msg.hasOwnProperty("d")) {
                    OnSuccess(msg.d);
                } else {
                    OnSuccess(msg);
                }
            },
            error: OnFailure
        });
    });

    function OnSuccess(result) {
        $.growlUI('AutoSave Successful');
    }

    function OnFailure(result) {
        $.growlUI("ID: " + id, "Answer: " + value);
    }
});

My Server side is pretty simple

    [WebMethod]
    public static void ClientSideSave(string identifier, string controltext)
    {
       //Bunch of code, shouldn't affect anything.
    }

Thank you in advance. Any help would be great, im pretty new to the world of Jquery and Ajax.

  • 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-25T06:15:58+00:00Added an answer on May 25, 2026 at 6:15 am

    You were close, but remember you are posting JSON, not form value collections. This means JSON strings are quoted during transport and in your example, will be quoted on the backend, probably not what you really want:

    var postdata = "{ 'identifier': 'id', 'controltext': 'value' }";
    

    3 mistakes to avoid when using jQuery with ASP.NET AJAX

    If you want use JSON(JavaScript Object Notation) the right way, then you should follow this example:

    Using complex types to make calling services less… complex

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

Sidebar

Related Questions

What does adding @ before a function do? I've seen this in some scripts
Before I start, I know there is this post and it doesn't answer my
Before I do this I figured I would ask if it was the best
I have a Custom Canvas(DesignerCanvas), user can add some controls to this canvas. Before
Is there a way to 'pre-build' a snippet of HTML before adding it to
I am wanting to compress results from QUERYS of the database before adding them
Where is Python's sys.path initialized from? UPD : Python is adding some paths before
Before you answer this I have never developed anything popular enough to attain high
I have stumbled across some code that is adding strings to a List but
I found this page which suggested adding the Jet OLEDB:System Database item to my

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.