Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6826285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:07:44+00:00 2026-05-26T22:07:44+00:00

Compiler Error Message: CS0122: ‘Controls_Arcade_StarDisplay.Stars’ is inaccessible due to its protection level I’ve checked

  • 0
Compiler Error Message: CS0122: 'Controls_Arcade_StarDisplay.Stars' is inaccessible due to its protection level

I’ve checked other SO threads but can’t make much sense of them. This control is being used inside another webusercontrol. Whenever I try and do anything with it it throws this error. The class in question is this:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="StarDisplay.ascx.cs" Inherits="Controls_Arcade_StarDisplay" %>
<asp:Panel runat="server" ID="Stars" />

Code behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.CompilerServices;

public partial class Controls_Arcade_StarDisplay : System.Web.UI.UserControl
{
    public double Rating { get; set; }
    public string Tooltip { get; set; }

    protected void Page_Load(object sender, EventArgs e)
    {
        string CSSClass = "star-rating s-";
        if (Rating < 0.25)
            CSSClass += "0";
        else if (Rating < 0.75)
            CSSClass += "05";
        else if (Rating < 1.25)
            CSSClass += "1";
        else if (Rating < 1.75)
            CSSClass += "15";
        else if (Rating < 2.25)
            CSSClass += "2";
        else if (Rating < 2.75)
            CSSClass += "25";
        else if (Rating < 3.25)
            CSSClass += "3";
        else if (Rating < 3.75)
            CSSClass += "35";
        else if (Rating < 4.25)
            CSSClass += "4";
        else if (Rating < 4.75)
            CSSClass += "4";
        else if (Rating < 1.25)
            CSSClass += "1";
        else if (Rating < 4.75)
            CSSClass += "45";
        else
            CSSClass += "5";
        Stars.CssClass = CSSClass;

        if (Tooltip != null)
            Stars.ToolTip = Tooltip;
    }
}

The control is registered in web.config:

    <pages validateRequest="false" smartNavigation="false" clientIDMode="Static">
        <controls>
            <add tagPrefix="Scirra" src="~/Controls/Arcade/GameOverview.ascx" tagName="GameOverview"/>
            <add tagPrefix="Scirra" src="~/Controls/Arcade/Stars/StarDisplay.ascx" tagName="StarDisplay"/>
        </controls>
    </pages>

The start display control is appearing inside the game overview control.

Thanks for any help, completely stuck! Other questions refer to getting properties of the controls I don’t understand, or changing things in the designer I can’t find either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:07:44+00:00Added an answer on May 26, 2026 at 10:07 pm

    This means that you have something in your user control called Stars and it is probably defined as private or protected.

    The issue is that this is a Web Site and not a Web Application and in a Web Site, .Net automatically creates the runat="server" controls as protected properties, so they cannot be exposed outside of the User Control or its direct inheritors.

    So there are two possible options:

    1. Convert the web site to a web application. This will cause a designer file to be created that contains the definitions of the controls. You can then take the control out of the designer file, place it in your codebehind, and change the access level to public.

    2. Since this is a control that will be accessed from other controls, a better design than exposing the control directly is to provide interaction methods that those other controls can use in order to encapsulate the behavior within this control. For example, exposing a SetRating method that accepts the rating and updates the Stars panel internally.

    Option #2 is definitely a better option from a design standpoint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error: Compiler Error Message: CS0118: 'Configuration' is a 'namespace' but is
<%# Eval(NAME).ToString() == Edit ? %> ' /> Error: Compiler Error Message: CS1525: Invalid
whats wrong with the below code, its throwing me an error of Compiler Error
Compiler Error Message: CS1002: ; expected Source Error: Line 56: </div><!--end #Asset--> Line 57:
Compiler Error Message: CS1977: Cannot use a lambda expression as an argument to a
I'm receiving an error message from the compiler indicating (it's an embedded C compiler):
i got this error: Compiler Error Message: CS1001: Identifier expected from this set of
Compiler Error Message: CS1705: Assembly 'Facebook.Web.Mvc, Version=5.0.3.0, Culture=neutral, PublicKeyToken=58cb4f2111d1e6de' uses 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
whats wrong with this code and i am getting this error: Compiler Error Message:
Hello all I'm a java newbie and I'm getting a compiler error message: src\LU62XnsCvr.java:33:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.