Hi folks,
kind of losing the plot here.....
I'm trying to access the Membership object to find the userID but getting loads of errors loads.
I take it we don't use Membership with 4.5 does anyone know the syntax to find a userID ?
This code works with 4.0 .net as I have used before!
private void IsUserAdmin()
{
string username = Page.User.Identity.Name;
var user = Membership.GetUser(username);
if (user != null)
{
Guid userID = new Guid(user.ProviderUserKey.ToString());
TyrescannerWebApp.IdentityModel.TyreScannerEntities dbcontext = new TyrescannerWebApp.IdentityModel.TyreScannerEntities();
var query = from p in dbcontext.Link_OrderProduct
select p;
GridView1.DataSource = query.ToList();
GridView1.DataBind();
}
} Go to the complete details ...