title: Can't access Class in some other class in c#?
body: <p>I have one class file JobSeekerBO it's has variable</p>
  
  <pre><code>   string _username = string.Empty;
     string _password = string.Empty;
  </code></pre>
  
  <p>and i set value as below</p>
  
  <pre><code>public string Username
  {
      get { return _username; }
      set { _username = value; }
  }
  
  public string Password
  {
      get { return _password; }
      set { _password = value; }
  }
  </code></pre>
  
  <p>but problem is that that variable i access in another class file  <code>class1.cs</code> i create object of that class file </p>
  
  <pre><code>JobSeekerBO objBO = new JobSeekerBO();
  </code></pre>
  
  <p>but i can't access <code>Username</code> and <code>Password</code> in <code>class1.cs</code> class file from my <code>JobSeekerBO.cs</code> file</p>
  
  <p>I also try to make that variable public as per below</p>
  
  <pre><code>public string _username = string.Empty;
  public string _password = string.Empty;
  </code></pre>
  
  <p>same class file varible without public access modifier we can access in <code>file1.aspx.cs</code> file</p>
  
  <p>So please tell me how to access variable and method of one <code>.cs</code> file to another <code>.cs</code> file.</p>
  
  <p><img src="https://i.stack.imgur.com/2qru0.png" alt="Page Code"></p>