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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:03:03+00:00 2026-06-07T21:03:03+00:00

Need to design several ASP.Net Web Forms that change based on User Type and

  • 0

Need to design several ASP.Net Web Forms that change based on User Type and Permission Levels.

There are seven User Types defined in the database (ClientType Table, ID = 0-7).

All Fields in the database that will map back to controls in our Web Forms are also defined by User Type with View/Add/Modify/Delete permissions and stored in a seperate table in the database.

ie

tbl_FieldAccess

FieldName = Client_Name (Client Name Field in our Client Table)
ClientType = 1
View = 1
Add = 0
Modify = 0
Delete = 0

FieldName = Client_Name ClientType = 7
View = 1
Add = 1
Modify = 1
Delete = 1

What is the best way (patterns, practices, specific examples) to now take my actual web form controls and map them to the records in my tbl_FieldAccess table and then use that to determine whether or not to show/hide the control, make it readonly, etc.?

Note: I have to use legacy login and authentication so ASP.Net Membership API is not an option here.

Using ASP.Net, C# and SQL Server.

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-06-07T21:03:05+00:00Added an answer on June 7, 2026 at 9:03 pm

    I’m recommending you to create a view model for your pages:

    class MyPageViewModel
    {
        public bool SendButtonVisible { get; set; }
        public bool EditButtonEnabled { get; set; }
        // many other properties ...
        public YourData Data { get; set; }
    }
    

    Then your aspx looks like:

    <asp:Button Id="btnSend" runat="server" Visible='<%# Model.SendButtonVisible" %>' />
    

    And your code behind:

        public class YourPage : Page
        {
             public MyPageViewModel Model 
             {
                 get { return (MyPageViewModel )ViewState["Model"]; }
                 set { ViewState["Model"] = value;  }
             }
    
             protected void Page_Load(object sender, EventArgs e)
             {
                if (!Page.IsPostBack)
                {
                    // put all business logic in your service layer
                    Model = YourServiceClass.GetMyPageViewModel();
                    DataBind();
                }
             }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to design a page for a web application that makes sense for
I have a design that has several divs at varying widths/heights and I need
We need to design a secure web application. I would like to propose a
I need to design a data structure that supports the following operations: search element
I need to design a system that will control access to certain information. The
I need to design database for SQL Server, is there any MySQL workbench like
I'm in the process of developing an ASP.NET MVC project, and after several weeks
I've several databases that contains the exact same base tables with identical design. Now
I have several files (they are XML but that's not important) that need to
Please help an EF n00b design his database. I have several companies that produce

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.