What namespace is it from, cause it shows me that User doesnt exist in the current context!
Here are my list of namespaces. Which one should i add:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Web.Configuration;
using System.Web.Security;
Another question, is that the way to check that the person who logged in is an administrator?
if (Roles.IsUserInRole(User.Identity.Name, "Administrators"))
{
You need the following namespace:
The easiest way to check for roles is: