2 Replies - 682 Views - Last Post: 05 April 2013 - 04:56 AM

#1 Black_Lion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 13

Creating separate admin account (Web Developer C#)

Posted 04 April 2013 - 04:38 PM

I am using Microsoft Visual Web Developer 2010 Express (C#) I am busy creating a website for a project, which involves users registering and logging on to a site. I have done that part, but I am not sure how I can create a separate account for only 1 admin.

I created a new webform and added a new login control, but the new login control only works for registered users, not admin (this maybe due to membership class). How can I create a separate account for one admin?

Is This A Good Question/Topic? 0
  • +

Replies To: Creating separate admin account (Web Developer C#)

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3716
  • View blog
  • Posts: 5,976
  • Joined: 08-June 10

Re: Creating separate admin account (Web Developer C#)

Posted 04 April 2013 - 06:08 PM

I don't know much about C# or ASP.NET WebForm development specifically, and how this ties into whatever built in user stuff they have, but in general you would add user "types" to your database, and then display different content based on what type of user is logged in. New users would be registered as "normal" users, or something like that, but a few chosen users could be elevated to a "admin" type, giving them special privileges.

If you consider this forum we are on. Members here are split into several types, much like I described. You are a "normal" user, able to log in and post stuff, but never modify things posted by others or perform any sort of administrative tasks. I, on the other hand, am a moderator, and do have abilities to alter the content of the forums. Our user accounts are still stored in the same database table, and the registration and login processes we use are the same. The forum software simply checks some user group field in the database stored with our user account records, and renders the pages differently based on which group we belong to.

This is what website typically do. You'll rarely see admins and normal users stored and operated completely differently by the system.
Was This Post Helpful? 0
  • +
  • -

#3 Black_Lion  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 31-March 13

Re: Creating separate admin account (Web Developer C#)

Posted 05 April 2013 - 04:56 AM

Thanks I figured it out in the end. One thing is when a user clicks a Navigation Button called "Admin" page, it goes back to the standard login (control) screen. How can I navigate it to another page with an error message, if a non-admin user clicks this Navigation Button? Only found one "NavigateUrl" property for this button, which directs to admin page
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1