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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:18:30+00:00 2026-06-10T05:18:30+00:00

I have an asp.net 4 webforms project. I have a form for managing existing

  • 0

I have an asp.net 4 webforms project. I have a form for managing existing users in the app, but some of the options may be grayed out or hidden for some users depending on their role within the application (admin, user, etc). E.g. an admin can change a user’s role from a drop down list, but a normal user would see the drop down list grayed out (or possibly hidden).

Of course, on the postback I can have a big function that checks all the conditions like “if a user less than admin modified property X, then ignore saving that change.” There may be a list of several of these checks for a single form.

But is there a better way in asp.net to handle this type of thing?

  • 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-10T05:18:32+00:00Added an answer on June 10, 2026 at 5:18 am

    Could use PrincipalPermissions to restrict a method from being executed by anyone other than a particular role

    Import System.Security.Permissions

    Place above the method

    <PrincipalPermissions(SecurityAction.Demand, role:="Admin")> _

    ...

    This isn’t going to hide the controls from users but I suppose you can either wrap that particular controls in a LoginView or control their visibility programmatically.

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

Sidebar

Related Questions

We have a Asp.Net Vb.Net application with around 35 webforms.There are some remote users
I have an existing asp.net webforms project that uses Microsoft's Enterprise DAAB for the
I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a
I have an ASP.NET project (VS2008 on Windows 7 with either webforms, MVC1, or
We have an ASP.NET 2.0 WebForms app that uses MS Ajax 1.0. It's working
I have a simple web app built in asp.net webforms c# where and how
I have an ASP.NET 3.5 webforms project written in VB that involves a multi-table
I have asp.net 4 webforms website which references PortableLibrary project. In the website I
My ASP.NET WebForms project heavily depends on JQuery. An on some level, I find
I have a classic ASP 2.0 project coming up. I mostly do ASP.NET WebForms

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.