<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%
if (Request.IsAuthenticated) {
%>
Welcome <b><%= Html.Encode(Page.User.Identity.Name) %></b>!
[ <%= Html.ActionLink("Log Off", "LogOff", "Account") %> ]
<br />
<% if(User.IsInRole("Administrator")) { %>
<br />
<%= Html.ActionLink("Home", "Index", "Home") %> | <%= Html.ActionLink("About", "About", "Home") %> | <%= Html.ActionLink("UserControl","UserControl","Account")%>
<% } else { %>
<br />
<%= Html.ActionLink("Home", "Index", "Home") %> | <%= Html.ActionLink("About", "About", "Home") %>
<%} %>
I want to check the role of the user if it is an administrator only then the user can see the link to user control.when i try to run this code it is giving me an error saying "'Data.User' does not contain a definition for 'IsInRole'"