title: ...is inaccessible due to its protection level c#/asp.net
body: <p>I have an application with a separate class, that i'm instantiating in the code behind-file (in Page_Load). In the class there's some methods that I want to be able to call from the code behind-file, but by some reason it doesn't work (SecretNumber.MakeGuess(int) is inaccessible due to it's protection level). The class as well as the methods are public so what can be the reason?</p>
  
  <p>// Default.asx.cs</p>
  
  <pre><code>...
  
  protected void btnCheckNr_Click(object sender, EventArgs e)
  {
      if (!Page.IsValid){
          return;
      }
  
      else{
          var guessedNr = int.Parse(inputBox.Text);
          var result = SecretNumber.MakeGuess(guessedNr); &lt;- inaccessible due to...
      }
  }
  </code></pre>
  
  <p>// SecretNumber.cs</p>
  
  <pre><code>public class SecretNumber {
  
      enum Outcome {
          Indefinite,
          Low,
          High,
          Correct,
          NoMoreGuesses,
          PreviousGuess
      };
  
      // Other code goes here...
  
      public Outcome MakeGuess(int guess) {
          // Other code here
      }
  }
  </code></pre>