public var, but says Inaccessible due to protection level

  • Thread starter Thread starter Jason Shohet
  • Start date Start date
J

Jason Shohet

I have a line:

public System.Web.UI.HtmlControls.HtmlTable bldgInfo;


Even though its public, for some reason every so often, .NET tells us that
bldgInfo table is inaccessible due to the protection level. Its an html
table -- but serverside. And it sits on a ascx (control).

When we try to access that table from somewhere else, we get that error.

Any ideas?

Jason Shohet
 
Where are you trying to access it from? Are you trying to access it from
another page?

Why?

bill
 
Yes we're accessing it from another page. I figured out the problem, in
that page the control has to have public in front of its declaration. But
..NET keeps changing it back to protected for some reason, and then it
doesn't compile because the elements on that control are no longer
accessible.... I change it to public, but .NET likes to set it back ;)
 
Back
Top