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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:21:07+00:00 2026-05-24T22:21:07+00:00

I have inherited a existing website with a large codebase. To handle ajax requests,

  • 0

I have inherited a existing website with a large codebase. To handle ajax requests, the site has just one file called ajax.ashx. Inside the file is a switch statement that looks like this:

switch (_json["m"])
{
    case "editDetails":
        if (requestIsValid(context))
            _resp = AjaxMap.editDetailsPro(_json);
        break;

    case "addNewContact":
        if (requestIsValid(context))
            _resp = AjaxMap.addNewContact(_json);
        break;

   // ... and so on.
}

There is about 50 different cases.

For me, this is not the natural solution – I would probably have a different handler for each group similar requests.

I haven’t worked with web technology much before. Is this the usual way to do it? And if so, what are the benefits?

  • 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-24T22:21:08+00:00Added an answer on May 24, 2026 at 10:21 pm

    It is perfectly OK.

    You save page lifecycle overhead that usually occurs when using Ajax in its default WebForms facilities (UpdatePanel etc.) or even over proxies such as WCF / WebService.

    Not to say that these infrastructures are useless, they are certainly not. But for the sole purpose of getting and request, do something and sending net data response – it’s fine.

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

Sidebar

Related Questions

I have inherited a large existing website to maintain. Previous developers have taken an
I've inherited an existing website to maintain and upgrade. One of the site's quirks
I just inherited an existing codebase that has multiple configuration files in it. These
I have inherited both an existing WinForms app and an existing .CHM file, created
I have inherited a client site which crashes every 3 or 4 days. It
We have inherited an ant build file but now need to deploy to both
I have inherited a load of VB6 code which has tons of individual OCX
I recently inherited a large codebase and am having to read it. The thing
I have inherited an existing code base where the features are as follows: huge
I have two different existing Database design's in the legacy apps I inherited. On

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.