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

Discussion in 'ASP .Net' started by Arjen, Jun 11, 2005.

  1. Arjen

    Arjen Guest

    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!
     
    Arjen, Jun 11, 2005
    #1
    1. Advertising

  2. Arjen

    Arjen Guest

    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





    "Arjen" <> schreef in bericht
    news:d8euk3$3h6$1.ov.home.nl...
    > 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!
    >
     
    Arjen, Jun 11, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Shohet
    Replies:
    1
    Views:
    484
    William F. Robertson, Jr.
    Aug 1, 2003
  2. sck10
    Replies:
    2
    Views:
    36,292
    sck10
    Aug 28, 2006
  3. Iain
    Replies:
    5
    Views:
    632
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Feb 20, 2007
  4. Walter Wang [MSFT]
    Replies:
    2
    Views:
    1,262
    Walter Wang [MSFT]
    Jan 19, 2007
  5. Chip Gore
    Replies:
    6
    Views:
    2,202
    Ben Voigt [C++ MVP]
    Apr 10, 2008
Loading...

Share This Page