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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:33:36+00:00 2026-05-24T07:33:36+00:00

I have some JQuery / JSON features on a website I’m working on. These

  • 0

I have some JQuery / JSON features on a website I’m working on. These features are going to be used on a few different pages so I’m wondering where I should put the code that returns the JSON. From what I understand I basically have 3 options. I could create an ASHX file, a web service ASMX or put a public static [webmethod] method on the page that’s using the feature. Because I’m reusing these features I suspect the last option is not the correct one. What would be best practice in this scenario?

  • 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-24T07:33:39+00:00Added an answer on May 24, 2026 at 7:33 am

    The serializer that ASMX ScriptServices and ASPX “page methods” (the static [WebMethod]) use is quite nice when you’re working with JavaScript/jQuery – more flexible and correct than WCF’s in several aspects – so don’t let anyone make you feel bad about using these approaches. Someone will almost always point out that ASMX is “obsolete”, but that doesn’t really square with the fact that File > New > Web Service still creates an ASMX service and is still a first-class item in .NET 4. Simplicity is a feature, and ASMX is hard to beat in that department.

    I would recommend against using an ASHX handler for returning JSON to the client-side, unless you’re piping JSON strings back from a third-party service.

    If you’re returning your own server-side objects, it doesn’t make sense to incur the extra code to manually convert to and from JSON when ScriptServices and page methods do it automatically. Even though it’s very easy to use JavaScriptSerializer to do so, why complicate things with that extra code at the beginning and end of every endpoint?

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

Sidebar

Related Questions

I have an jQuery JSON request, that loads some JSON from another server (ex.
I have some jQuery code which retrieves content using getJSON(). There are n JSON
As it stands, I have some JQuery along these lines - ph=function(i){ $.each(i,function(po){ id=po.id;url=/+id;t=$('<div
I have the following JSON: {COLUMNS:[ID,FIRSTNAME],DATA:[[1,Steve],[2,Jim],[3,Bill],[4,Tony]]} I am trying to write some jQuery that
I have some confusion over a jQuery extension not working as I'd expect. I
I have a website on foo.com serving PageA . PageA has some JQuery within
I have some web services that receive JSON data send by jquery method. But
I have some jQuery/JavaScript code that I want to run only when there is
I have some jQuery code. I have called an Ajax function file, file.php, that
I have some jquery code that is doing an ajax lookup and returning comma

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.