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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:23:19+00:00 2026-06-13T08:23:19+00:00

This works [System.Web.Services.WebMethod] public static string Save_HH() { return abc; } This does not

  • 0

This works

[System.Web.Services.WebMethod]
public static string Save_HH()
{
    return "abc";
}

This does not work

[System.Web.Services.WebMethod]
public static string Save_HH(string myString) // (int i, string s) (object o) etc
{
    return "abc";
}

This is the ajax call

$.ajax({
    type: "POST",
    url: "Default.aspx/Save_HH",
    data: {}, // data: JSON.stringify({abc:123}),
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (response) {
        btn.css("visibility", "visible");
        $("#ta_response").text(response.d);
    },
    fail: function () {
        alert("fail");
    },
});

This error message is POST localhost(cant post link on my new account)/Default.aspx/Save_HH 500 (Internal Server Error)


At this point the question seems fairly clear and concise but I was just prevented from posting it as is. I don’t want to say anything more because I think it is a well formed question and saying anything else would make the reader confused.

  • 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-13T08:23:20+00:00Added an answer on June 13, 2026 at 8:23 am

    If you replace this:

    data: {}, // data: JSON.stringify({abc:123}),
    

    with this:

    data: { myString : "test" }
    

    it should work out of the box.

    Just remember that the name and type of the parameter you’re passing through the $.ajax call must match the parameter name and type you declared in the WebMethod. Otherwise the binding won’t occur and your myString parameter will be null (in the case of a string type) inside the WebMethod Save_HH.

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

Sidebar

Related Questions

I have a web method: [System.Web.Services.WebMethod] public static string getCharacterstics(int product_id, int lang_id) {
This aspect of my login system works just fine if I have the return
This seems to work fine in C#: class A : System.Attribute { public A()
System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes(path)) So this is a work around to not being able to use T4
This works. $(document).ready(function(){ $(.items article).click(function(){ window.location=$(this).find(a).attr(href); return false; }); }); However , when the
web method: <WebMethod()> Public Shared Function Pcpacking() As IEnumerable(Of Packing) Dim db As New
In my asmx file, I have [WebMethod] [ScriptMethod] public void Method(IDictionary<string, CustomClass> objectOfCustomClass) {
I have the following web service: [ScriptService] public class Handler : WebService { [WebMethod]
Connecting to outside Web Services from Dynamics CRM 2011 online works from a US
This is my code for counting lines and words: import System.IO import Data.List main

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.