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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:02:41+00:00 2026-05-23T08:02:41+00:00

I have forms that make AJAX calls for data like below: $.ajax({ url: /adminTasks/GetJsonDSData,

  • 0

I have forms that make AJAX calls for data like below:

 $.ajax({ url: "/adminTasks/GetJsonDSData",
          data: { ABC: "Abc" },
          success: function (data) {

 etc.

The calls work fine but add to the code in my controllers. I would like to move the methods behind these calls outside of the controllers but I am not sure how to do this. Seems like all the calls must be routed to a URL of a controller.

I had the idea to move the methods into helper classes in my storage project. This works fine and now I can have the action go to the controller which then calls the storage methods and which then returns data to the controller.

Is there any way I can take the controllers out of the loop to simplify things?

  • 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-23T08:02:41+00:00Added an answer on May 23, 2026 at 8:02 am

    My suggestion is to make sure that all code related to obtaining data from the datbase is in your service layer.

    Your controller will be making calls to the service to receive specific data for the purpose of sending it to the front end.

    If you feel that you have too many JSON methods in your adminTasks controller I recommend you move them to a more appropriate controller.

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

Sidebar

Related Questions

I have many forms that use AJAX (w/ jQuery) for validation and data submission.
I have some forms that communicate with server using AJAX for real reasons: cascade
I have a javascript function that posts data to a validation script and grabs
I have the following JQuery AJAX call that sends HTML form data to my
In a typical business application it is quite common to have forms that are
Hi have some forms that I want to use some basic php validation (regular
I have a few forms that use tiny mce. I have noticed recently that
I'm creating a few web forms that have areas to them. Are fieldsets viable
vb.net windows forms question. I've got 3 forms that have exactly the same functions,
I have a series of forms that I need a user to complete in

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.