I'm working with MVC 5 and I have the following code in my View:
@if (Roles.IsUserInRole("admin"))
{
<li class="@Html.IsSelected(controller: "Vacants")">
<a href="#"><i class="fa fa-edit"></i> <span class="nav-label">Vacants</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li class="@Html.IsSelected(action: "Create")"><a href="@Url.Action("Create", "Vacants")">Create New Vacatns</a></li>
<li class="@Html.IsSelected(action: "Morris")"><a href="@Url.Action("Edit", "Vacants")">Edit Vacant</a></li>
<li class="@Html.IsSelected(action: "Rickshaw")"><a href="@Url.Action("Delete", "Vacants")">Delete Vacant</a></li>
<li class="@Html.IsSelected(action: "Chartjs")"><a href="@Url.Action("History", "Vacants")">History</a></li>
</ul>
</li>
}
At the begining, when I ran my web site I got a error message saying that the RoleManager feature was not enable. So, I enable it in the web config.
<system.web>
. . .
<roleManager enabled="true" />
</system.web>
After that the error disappeared. However, now I'm getting another one:
Unable to connect to SQL Server database
Why this error is appearing? Is there any configuration that I missing and needs to be set up?
Thanks in advance