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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:37:08+00:00 2026-05-24T00:37:08+00:00

I made a page method in the .cs file of my Default.aspx: [WebMethod] public

  • 0

I made a page method in the .cs file of my Default.aspx:

[WebMethod]
public static string ReturnSerialized(object var)
{
    JavaScriptSerializer jsSerializer = new JavaScriptSerializer();

    string serialized = jsSerializer.Serialize(var);

    return serialized;
}

The function accepts a serializable object and converts it to json.

On my Default.aspx page, inside <form> I added <asp:ScriptManager ID="scriptManager" EnablePageMethods="true" runat="server" />. Everything works fine, but in Firebug there is an error:

missing formal parameter
[Break On This Error] ReturnSerialized:function(var,succeededCallback, failedCallback, userContext)

I’m just wondering how I could handle this error. I’m developing in VS2010, and the jquery lib I’m using on the Default.aspx is 1.6.2.

BTW, if this is similar to another post, please feel free to let me know. Thanks.

  • 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-24T00:37:10+00:00Added an answer on May 24, 2026 at 12:37 am

    The error is due to the fact that reserved java-script keyword var has been used as a function parameter. The erroneous line of code

    ReturnSerialized:function(var,succeededCallback, ...
    

    is part of proxy code generated by microsoft ajax.

    Good news is that from your subject line, it appears that you are using jquery ajax method to access the page method. In such case, you don’t need the proxy js code – so you can turn it off by setting EnablePageMethods="false". That would also result in decrease in page size – that’s the one of reason, I use jquery to access page methods.

    Regardless, I will also suggest you to change your parameter name so that you/other developer does not get into such subtle issues in future.

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

Sidebar

Related Questions

I made a custom master page. I also made a custom CSS file, which
I made a solution to deploy a custom master page (a WSP file). After
I made ​​an application to copy a file using thread and the method of
I made a page, 3 cols, tableless and css formated (as it should be).
I have to made a page which will send Email to Newsletter subscribers. There
I have made a page in which i m using a list to display
I made a new page in our website that needs to access some functions
i made an HTML page with all widths and heights as percentage that's primary
Is it possible to intercept every request made from a page using javascript? i.e.
Is there a way to access the http request IE made when the page

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.