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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:54:22+00:00 2026-05-22T21:54:22+00:00

Is there a way to call a Page Method in jQuery when the page

  • 0

Is there a way to call a Page Method in jQuery when the page method has a “params” argument type (in C#)?
I can call Page Methods all day long using jQuery if I specify the arguments one at a time, but if I put them as “params object[] args” it throws an error about not finding the “args” parameter.

I am trying to call a method with the following signature:

public static string MakeWebServiceCall(string methodName, params string[] args)

But it only works if I specify it explicitly like this:

public static string MakeWebServiceCall(string methodName, string place, string type, string token)
  • 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-22T21:54:23+00:00Added an answer on May 22, 2026 at 9:54 pm

    Just double-check your JavaScript. It’s more likely the culprit than a problem with your C#, as the significance of the params reserved word is non-existant. The argument is still ultimately an array of strings, which is nothing special to JSON. I’ve just built a quick test page which resulted in absolutely no problems using your method. Try double-checking your syntax against the following:

    $.ajax({
      type: "POST",
      contentType: "application/json; charset=utf-8",
      url: "MyPage.aspx/MakeWebServiceCall",
      data: '{"methodName":"myMethod", "args":["my","array","of","strings"]}',
      dataType: "json"
    });
    

    OR if you’d like, stringify a data object using a JavasScript JSON library (native with newer browsers). This method is my personal favorite since I won’t have to double-check that I’ve built my JSON string correctly. Just be sure to enable legacy support for IE7 if you’re feeling kind:

    var data = {};
    data.methodName = "myMethod";
    data.args = ["my","array","of","strings"];
    
    $.ajax({
      type: "POST",
      contentType: "application/json; charset=utf-8",
      url: "MyPage.aspx/MakeWebServiceCall",
      data: JSON.stringify(data),
      dataType: "json"
    });
    

    If you’re having difficulty with some of the particulars of how these arguments are constructed, you might check out this great resource article from Encosia that I go back to frequently just to remind myself of the basics of consuming web services and page methods with jQuery. It explains a couple of the oddities, including links back to pages which talk about why the contentType encoding is important, as well as information as to why the full JSON string must be provided to the data argument rather than just a JavaScript object.

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

Sidebar

Related Questions

Is there a way to call Static Classes / Methods by name? Example: $name
Quick question, is there a way to call your main method whatever you like
Question in Short: Is there a way to hide the submission page of jQuery
I am using jQuery to call WebMethods (page methods) on a ASPX page. When
Is there a way to call an external script or program from Flash CS3
Is there a way to call an EJB that is served through WebSphere (iiop://host:port/ejbName)
Is there any way to call a function in C# when the user exists
Is there any way to call an action script function from an anchor which
Is there a way to call send / recv passing in a vector ?
is there a way to call java me application out of Symbian's C++ app?

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.