Damien Sullivan

Damien Sullivan

  • 1.9k
  • 26
  • 3.7k

Hide/Display Content Based on Which User is Logged In

Jan 29 2017 6:15 AM
I am developing an ASP.NET Web forms website using C# and SQL Server. 
Here is my requirement:
There are 3 users of the website, Anonymous, Master Admin and General Admin.
Anonymous: Users who are not logged into the website, but can view all pages except Admin.aspx.
Master Admin: Logged in, can view all pages, and all content on Admin.aspx
General Admin: Logged in, can view all pages, but only some content on Admin.aspx. 
I have tried to copy this tutorial: http://www.aspsnippets.com/Articles/Implement-Role-based-security-Page-access-and-ShowHide-Menu-items-based-on-Role-in-ASPNet.aspx but I haven't been able to get it working.
Can anyone point me to another example?
The problem with the above example is that I'm getting stuck on the Validate_User stored procedure, where am I going wrong? 

Brought to you by:

Answers (2)