As the error says, postpanel
is defined as a protected member. If you want to access it outside of the first
class, you can define a public property (in first.aspx.cs) that exposes it. Something like:
public partial class first : System.Web.UI.Page
{
public Panel PostPanel
{
get { return postpanel; }
}
}
first d = new first();
d.PostPanel.Visible = false;
But, as KARTHIK Bangalore wrote, I don't see any reason of doing that.