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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:53:05+00:00 2026-06-10T22:53:05+00:00

I try to use ajax call in my aspx page. Here is my script:

  • 0

I try to use ajax call in my aspx page. Here is my script:

<head runat="server">
<title></title>
<script type="text/javascript" src="jquery/ui/jquery-ui-1.8.23.custom.js"></script>

<script type="text/javascript" language="javascript">

    $(document).ready(function () {
        $.ajax({
            type: "POST",
            url: "WebForm1.aspx/List",
            data: '{}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function () {
                alert('asd');
            }
        });

    });

</script>
</head>

Here is my server side code:

 [WebMethod]
 public static string[] List()
 {
      ...
 }

I put a break point List’s first row but nothing happen. Do you have any suggestion, where I make a mistake?

  • 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-10T22:53:06+00:00Added an answer on June 10, 2026 at 10:53 pm

    The parameter you’re specifying is json; but where’s the json data?? data: '{}', is an object. Also, I’d check the url parameter. Presumably, you’d need to write your call like this:

    var AjaxData = '{"ParameterName":""}';
    
     $.ajax({
                type: "POST",
                url: "../WebForm1.aspx/GetList",
                data: AjaxData ,
                contentType: "application/json; charset=utf-8",
                dataType: "json",....
    

    And then on the server side, you should therefore specify that you’re receiving a string, since that’s the format of json data. I would also recommend changing the name of the WebMethod because List can be confusing. And finally, you’re returning json, therefore you’re returning a string and not an array. Server method like this:

     [WebMethod]
     public string GetList(string ParameterName)
     {
          ...
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the the following ViewModel <script type='text/javascript'> $(function () { var dropdownCtor =
I have a page with several user controls that use Ajax. When I try
I try to use a variable in my kshell script but can't get a
I try to use SQL SERVER VIEW within RIA Services. So I created some
i try to use jquery .text() but not really work : Before <a id=group_name
When i try to use spring 2.5.x DispatcherPortlet with liferay to use Ajax, i
I try to do an AJAX call with jQuery and $.post in Internet Explorer,
If I try to get a partial control via ajax call, and the session
I use the following ajax code to load html page: var AJAX = {
I have 2 checkboxes constructed after performing an ajax call. When I try to

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.