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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:40:00+00:00 2026-06-14T04:40:00+00:00

Currently I have a folder structure like this: Area (folder) – Toolkit (folder) –

  • 0

Currently I have a folder structure like this:

Area (folder)
 - Toolkit (folder)
    - Controllers (folder)
        - AdminController.cs
    - Views (folder)
        - Admin (folder)
           - Privledges (folder)
              - Create.cshtml
              - Edit.cshtml
              - Delete.cshtml

Which translates to

/Toolkit/{controller}/{action}/{tool}/{id}

Is it a bad practice to set up the action to behave a like a controller that serves up a view based on the string {tool} parameter and parameter {id} passed to the action?

The implementation of what I am talking about:

    private const string FOLDER_PRIVILEGES = "./Privileges/";

    public ActionResult Privileges(string tool, string id = "")
    {
        dynamic viewModel = null;
        ToolViews view; // enum for the views
        // Parse the tool name to get the enum representation of the view requested
        bool isParsed = Enum.TryParse(tool, out view);

        if (!isParsed)
        {
            return HttpNotFound();
        }

        switch (view)
        {
            case ToolViews.Index:
                viewModel = GetIndexViewModel(); // call a function that gets the VM
                break;
            case ToolViews.Edit:
                viewModel = GetEditViewModelById(int.Parse(id)); // sloppy parse
                break;
            default:
                viewModel = GetIndexViewModel();
                break;
        }
        // The folder path is needed to reach the correct view, is this bad?
        // Should I just create a more specific controller even though it would
        // require making about 15-20 controllers?
        return View(FOLDER_PRIVILEGES + tool, viewModel);
    }

When I write a View, I have to make sure the Path name is used for the folder

@Html.ActionLink("Edit", "./Toolkit/Admin/Priveleges/Edit", "Admin", new { id = item.id })

This seems to be a poor practice, because if the folder structure changes at all it will require a lot of maintenance.

However, if I have to break out the actions into controllers there would be many of them (almost 20 with more added over time).

If what I am doing is a bad practice, what would be the best way to serve a route that looks like this?

/Toolkit/Admin/Privileges/Edit/1

I want to avoid doing the following:

/Toolkit/Admin/CreatePrivileges/1
/Toolkit/Admin/EditPrivileges/1
/Toolkit/Admin/DeletePrivileges/1

Please let me know if I’m not making any sense, because I am having a hard time putting this question into words.

  • 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-14T04:40:01+00:00Added an answer on June 14, 2026 at 4:40 am

    I think you’re trying to force a convention into MVC that goes against its orignal intent.

    With MVC, your controller is a noun, and your action is a verb. Using your examples, you have:

    • Toolkit (noun) – Area
      • Admin (noun?) – Sub-area? <– this is the one that’s a little funky
        • Privileges (noun) – Controller
          • Create (verb) – Action
          • Edit (verb) – Action
          • Delete (verb) – Action

    So as you can see, if you can consider Toolkit + Admin as area + subarea, or combine them into one area (TookitAdmin), it would get you back to the original purpose for controllers and actions.

    Based on the comments, it sounds like you may have decided to go this way. But I wanted to point out that the conclusion you came to in a round-about way is getting back to the roots of MVC.

    As a side note, have you considered moving to MVC4? Its Web API provides better support for a RESTful API, which it sounds like you may be trying to get to.

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

Sidebar

Related Questions

I currently have this set up and working fine inside a users folder. RewriteEngine
folks, I have the directory structure like this: webapps |-- static_media |-- django |---project
I'm wondering if anyone can do this. Say I have this folder structure: Folder
I have a module with a pretty annoying tree structure like this APP -CODE
I have a C++ project with a folder structure something like so: root/trunk root/trunk/src/...
I have a directory structure in my Php mvc app that is currently like
currently i have a /en/ folder that is empty except for a .htaccess with
I have folder on which i want to apply security like the current user
Currently have password protection on my main and sub directories, however I'd like to
I have a SVN repository which is currently structured like so: /versions /1.0.0 /1.0.1

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.