Very simple declaration in masterpage causing this error
"Compiler Error Message: CS0103: The name 'User' does not exist in the current context"
here is the masterpage codebehind file
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (User.IsInRole("Administrators"))
ImageButton.Visible = true;
can anyone help?
Loading
Sateesh ArvetiPosted Jul 15, 2008, 3:30 AM
I suppose there is no problem with Master Page.Please use HttpContext.Current.User instead of User.Since,it is saying User does not exist.