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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:49:56+00:00 2026-05-26T13:49:56+00:00

I am in the process of writing a web app that includes a reporting

  • 0

I am in the process of writing a web app that includes a reporting form. This form contains a number of radio buttons that allow the user to specify the return data.
There are about 6 different return data ‘formats’, and each of those has two variations – html data or JSON data for rendering to a chart.

I have begun coding it up and already my form post action method feels wrong.
I basically have a check on the requested data format and return it as needed. Each return type requires its own partial view / json object so there is little room for reusing code.

It feels like each one should have its own action method. Having the form post to different locations based on a radio button choice also feels wrong though.

Switching on report type and then redirecting to the appropriate action in the controller also feels like its not quite right.

Am I approaching this in the wrong way? As it currently stands my controller action contains a lot of code and a lot of logic…

Hope my query makes sense.

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-26T13:49:57+00:00Added an answer on May 26, 2026 at 1:49 pm

    I don’t think there is anything wrong with your approach. To maximize reuse you could:

    • include reusable templates inside your views
    • make sure the business/data layer code is the same everywhere (where possible)

    I suppose the views you need to return actually are different for each combination of options so whatever approach you take, you are stuck with that.

    I wouldn’t opt for the client-side approach. You then have code on both the server and the client that has to be updated whenever you change anything. I would keep the code that receives a set of options and determines what to do with them in one place.

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

Sidebar

Related Questions

I'm in the process of writing a small web app that would allow me
I am in the process of writing a web-app that uses multiple web APIs.
I am writing a Web app that will need to run a background process
I'm writing a web app that will use twitter as its primary log on
I'm in the process of writing a WCF service that will allow an ASP.Net
We are in the process of writing a native windows app (MFC) that will
I'm currently writing a C# console app that generates a number of URLs that
I have an app that I am in the process of writing and I
I'm writing an iPhone app that requests data from a web service, and in
I'm writing a web app that needs to use several ansi C functions to

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.