Hi (I'm pretty new to this),
I have a login control in my C# program and once the user logs in, they are able to see links to other programs (a portal). Is it possible to hide the 'create new user' link to everyone except the admin once the user has logged in? Is this something I'd change in the web.config as I only want admins to be able to create new users (I use a CreateUserWizard for this).
Thank you.
I'm assuming that 'admin' is a role in your application. If so, you can use a LoginView control.
<asp:LoginView id="LoginView1" runat="server">
<RoleGroups>
<asp:RoleGroup Roles="Admin">
<ContentTemplate>
Stuff only an administrator can see
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
You can also do in programatically, using the IsUserInRole method, e.g:
somePanel.Visible = Roles.IsUserInRole("Admin");