...is inaccessible due to its protection level. ?

A

Arjen

Hi,

I have this inside a webusercontrol:
private string MenuItem = new string[2];

Inside the .ascx file I do this:
<%= MenuItem(0) %>

And I get this error:
....is inaccessible due to its protection level

I have changed private to public and even removed it... I always get the
same error.

Can somebody help me?

Thanks!
 
A

Arjen

Hmmm, found it with <%= MenuItem[0] %> and public

Now I get this error when doing this: MenuItem[x] = "";
Compiler Error Message: CS0200: Property or indexer 'string.this[int]'
cannot be assigned to -- it is read only
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top