the following code in the master.cs file
public bool MenuIssuesManagementVisible //defining the set false visibility property
{
get { return lnkIssuesManagement.Visible; }
set { lnkIssuesManagement.Visible = value; }
}
public bool MenuTimeFilterVisible
{
get { return lnkTimeFilter.Visible; }
set { lnkTimeFilter.Visible = value; }
}
is setting a property which i use in a web content form in the following way–>
((Default)this.Master).MenuIssuesManagementVisible = false;
((Default)this.Master).MenuTimeFilterVisible = false;
but whenever i run the web content form, i get an error at the line
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Line 27: set { lnkTimeFilter.Visible = value; }
how do i rectify that?
NullReference is coming from the line shown – there’s only one object reference there – lnkTimeFilter is null. Beyond that it’s hard to say with the information you’ve provided. Perhaps it is not a direct child of the master page? Where is lnkTimeFilter declared?