I am working on a project trying to implement a way to display a specific category when someone is logged in as a custom role (Wholesaler). The problem is determining whether a person belongs to a specific role. The end goal is to hide a wholesale category for regular registered users, and then for wholesalers hide all categories except the wholesale category.
Tried using this code to determine the user role:
@(HttpContext.Current.User.IsInRole("Wholesaler"))
But it results in an error:
Unable to connect to SQL Server database. ---> System.Data.SqlClient.SqlException (0x80131904): Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed
Can anyone help out?