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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:46:23+00:00 2026-05-13T17:46:23+00:00

I am working on an ASP.NET WebForms project, and we need the ability to

  • 0

I am working on an ASP.NET WebForms project, and we need the ability to configure behavior throughout the application based on the current user’s “group”. This applies to almost all aspects of the application, including site navigation, showing/hiding certain user controls on pages, and executing custom business logic in some cases. However, the vast majority of the application behavior is shared among groups, so we’ve ruled out the idea of creating entirely separate apps.

Essentially, what I’m looking for is an architectural approach to implementing custom behavior in an ASP.NET WebForms application. Is there a better approach than sprinkling if/else statements throughout the code base in the view layer, the business layer, and the persistence layer?

Edit: Some examples:

  • If a user in in Group A, their
    navigation will consist of all
    navigation from Group B plus a few
    additional links.

  • If a user is in Group A, a page will
    show user controls c1, c2, and c3.
    If the user is in Group B, they will
    only see c1 and c3 on the same page.

  • If a user saves some data on a form
    and they are in Group A, send a
    notification email. If the user is
    in Group B, send a text message
    instead.

We can solve all of these specific problems, but are looking for a way to encapsulate this behavior as much as possible so it’s not scattered across the code base.

Edit: There are some interesting answers related to dynamically loading user controls. Should the logic to determine which controls to load or which behavior to use based on the user’s group be encapsulated in one (non-cohesive) class, e.g.:

GroupManager.GetNavigationControl(int groupId) // loads site nav control based on group
GroupManager.PerformNotification(int groupId) // sends text or email based on group

Or should this logic exist as close as possible to the location in code where it is used, and therefore be spread across the different layers of the code base?

  • 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-13T17:46:23+00:00Added an answer on May 13, 2026 at 5:46 pm

    Well there’s not a ton of details to go on here, but I would suspect you might benefit from polymorphism (i.e. various interface implementations) to deal with the parts of the application that differ between user groups. An Inversion of Control container like Spring.NET can help you wire up/configure these various implementations together based on the current user role. You might also benefit from Spring’s Aspect Oriented Programming API in which you can decorate methods in your business layer/data access layer so that authorization logic can be executed.

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

Sidebar

Related Questions

In the current MVC project I'm working on, I need to be able to
I'm working on a personal project (C# / ASP.NET) that will use LINQ to
I have a pretty big web application that I created last year using ASP.NET
Looking for some help on some names for a project I'm currently working on.
Last week , my boss ask my team to evaluate ASP.NET MVC, for next
Here's my particular situation... I have a decent amount of experience with webforms, and
I'm currently working on a high-traffic online search site. They have various changes they
I'm writing a semi-generic form plugin using jQuery in order to speed up the
I know this topic has been discussed to death, but there is one thing

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.