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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:47:15+00:00 2026-05-28T05:47:15+00:00

I am using VS2005 .NET 2.0 C#. I am currently managing my user roles

  • 0

I am using VS2005 .NET 2.0 C#.

I am currently managing my user roles by the build in ASP.NET Web Site Administration Tool, managing users etc, as well as using ActiveDirectory authentication

I have 2 questions.


Firstly, is there any sample code which I can refer to on the web in order to implement the role editing of the ASP.NET Website Admin Tool onto my webpage? The GUI need not be there, I only require the username and the role checkboxes on my webpage.

enter image description here
Working code examples will be appreciated


Secondly, I have been receiving an error when I tried to create a new user after I have changed my authentication from Web to Windows, which uses ActiveDirectory. Below is the error:

enter image description here

Is it because AD does not allow creating of new users or is it because the account I provided in my connectionUsername and connectionPassword in the web.config does not have sufficient privilege?


EDIT:

For my first question, I have a button which loads the user role from a database.

enter image description here

Below is the method:

protected void loadUser_Click(object sender, EventArgs e)
{
    AdminCb.Checked = false;
    UserCb.Checked = false;
    SqlConnection conn = new SqlConnection("Data Source=TP;Initial Catalog=MP;User ID=user;Password=password");
    string sql = "SELECT [User Type] FROM [UserRoles] where [Name]=@Name";
    SqlCommand cmd = new SqlCommand(sql, conn);
    cmd.Parameters.Add("@Name", SqlDbType.VarChar, 50).Value = UserNameList.Text;
    conn.Open();
    Object result = cmd.ExecuteScalar();
    conn.Close();

    if (result != null)
    {
        string usertype = result.ToString();
        if (usertype == "Super User")
        {
            AdminCb.Checked = true;
        }
        if (usertype == "Normal User")
        {
            UserCb.Checked = true;
        }

    }
}

Is it possible for me to retrieve the list of users from ActiveDirectory and implement it similar to my method above?

  • 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-28T05:47:16+00:00Added an answer on May 28, 2026 at 5:47 am

    As for your first question, the Website Admin Tool is simply a web interface that sits on top of the Membership API. In other words, if you click something like “add a new role” on the Web Admin Tool, you’re basically calling Roles.CreateRole().

    How you want to design your web interface is up to you. But to utilize the complete functionality of the Website Admin Tool, you need to implement many of the classes in System.Web.Security namespace.

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

Sidebar

Related Questions

Im currently using vs2008 with asp.net mvc framework for web development. Im missing a
I'm using VS2008 to develop my ASP.NET web site, I know how to use
I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather
I am using VS2005 .NET 2.0 C#. I am currently referencing to a website
Am using VS2008 ASP.Net Web Forms have a detailsview, databound to web service reference
I am using VS2005 C# ASP.NET. I have a webform which contains a list
I'm developing a small web application in ASP.Net (framework version 3.5) using VS2008 and
Currently I'm looking at a problem with web references in vs2005 .net I have
How to solve this problem? I am using asp.net 2.0, vs2005 and IIS 5.1.
As outlined in Tip/Trick: Optimizing ASP.NET 2.0 Web Project Build Performance with VS 2005

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.