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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:16:57+00:00 2026-06-01T05:16:57+00:00

I’m currently new into client-side programming, especially using the Jquery Ajax method to call

  • 0

I’m currently new into client-side programming, especially using the Jquery Ajax method to call server-side methods.

Until now I’ve used a System.Web.Services.WebService to host multiple methods to return a String or a bool. This approach has the advantage, that I can “group” methods with a similar purpose, like “methods for a comment-system”. A disadvantage, as I’ve read many times, is that *.asmx services are outdated and the Json support isn’t that well.

I’ve always read that a good way to provide methods that return JSON objects is the use of generic handlers (*.ashx). Generic handlers that I’ve written in the past provided only one single “action” per handler.
Is using generic handlers for a JSON datasource the way to go? I clearly see the disadvantage of not being able to “group” methods, because each method would be in a seperate .ashx.cs file. (I know that I could pass a second argument that determines which “action” should be called, but somehow doesn’t feel right).

Using a WCF service is not a worthwhile option at the moment, because the methods that I use need access to the session and adjusting a service to fit the same purpose is just an overkill for now.

I guess the real question is: What is a modern way to return JSON objects / List of JSON objects while maintaining readability / structure of the service-side methods?

Edit: I’m using Webforms 4.0

  • 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-01T05:16:59+00:00Added an answer on June 1, 2026 at 5:16 am

    I have moved onto MVC, which makes this sort of thing a lot easier. But when I did this in WebForms, I would use one or more handlers (ASHX) that took in an action parameter. The action parameter would then be evaluated against to call the appropriate target method which would handle the response.

    If you go this route, you’re saving yourself the headache of all those files. And what you lose in having to specify an action parameter on your ajax calls, you gain in not having to specify different file names.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

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.