473,394 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

public var, but says Inaccessible due to protection level

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
Nov 17 '05 #1
2 2952
Where are you trying to access it from? Are you trying to access it from
another page?

Why?

bill

" Jason Shohet" <as****@hotmail.com> wrote in message
news:eB**************@TK2MSFTNGP11.phx.gbl...
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

Nov 17 '05 #2
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 ;)
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Larry | last post by:
Thanks in advanced for your help I've added a TextBox1 and Button1 to a form in C# in VS.net 2003. When I double click on the Button1 at design time, a private method ButtonClick. I've...
1
by: Larry | last post by:
I have a VB background and am developing a new windows app in Csharp. I'm getting the error. 'inaccessible due to its protection level' I've added a TextBox1 and a Button1 to a form. I...
5
by: Jassim Rahma | last post by:
Hi, I have a problem with the public class. I am trying to save the last identifier which I am getting correctrly but when I try to read I am getting 0. The public class is like this: ...
2
by: Octavio Hernandez | last post by:
Hi, I have a seemingly easy problem drivin' me nuts. I'd be grateful for any hint on what may be causing it. The fact is I'm developing an ASP.NET web site. At some point, I need to read a...
2
by: sck10 | last post by:
Hello, I am getting the following error: fvServiceIdea_ItemUpdating_Validate(object, System.Web.UI.WebControls.FormViewUpdateEventArgs)' is inaccessible due to its protection level. Below...
2
by: Irfan | last post by:
hi, In C#.Net, if i have a form1 and i want to access one of the controls of form2(eg a label) from Form1, it gives an error. (Label1 is Inaccessible, due to its protection level) However, i...
1
by: =?Utf-8?B?d3BjbWFtZQ==?= | last post by:
I got the following code public ref class A { value struct PrivateType sealed { Int32 id; }; public: ref struct B abstract sealed { static const PrivateType x = {1}; static const PrivateType...
5
by: Jay | last post by:
In both of the UnitTest projects that ship with the Ent Lib, (VSTS and Nunit), there is a TestMethod with the name: AttributeWithLowerAndUpperBoundsOnlyCreatesAppropriateValidator. Each of these...
0
by: Vinod Sadanandan | last post by:
STANDBY DATABASE MONITORING & PROTECION MODES (9iR2) This document is written for understanding and monitoring standby database configured with diffrent protection modes . MAXIMUM PROTECTION ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.