title: Update asp:label on another page?
body: <p>I'm working with an asp.net website using C# in the background. I would like to be able to update an asp:label on a page, lets say <strong>Page1.aspx</strong>. I want this be updated depending on the outcome of a function in a class (.cs) in other folder. This could be <strong>behind.cs</strong>.</p>
  
  <p><strong>behind.cs</strong></p>
  
  <pre><code>*some other code is here*
  bool correct = false;
  try
  {
      if (_myConn.State == ConnectionState.Closed)
      {
          _myConn.Open();
          myCommand.ExecuteNonQuery();
      }
      if (Convert.ToInt32(myCommand.Parameters["@SQLVAR"].Value) &lt; 1)
      {
          "Invalid Login" // I want to be the text of lblMessage.Text
      }
      else
      {
          correct = true;                 
      }
      _myConn.Close();
  }
  catch (Exception ex)
  {
      "Error connecting to the database" // I want to be the text of lblMessage.Text
  }
  return correct;
  </code></pre>
  
  <p><strong>page1.aspx</strong></p>
  
  <pre><code>&lt;asp:label runat="server" ID="lblMessage" cssClass="error"&gt;&lt;/asp:label&gt;
  </code></pre>
  
  <p>How can I update the asp:label on <strong>page1.aspx* from **behind.cs</strong>??</p>