title: passing values between separate classes
body: <p>I have two separate classes: 1 In a tbIndexUI.aspx.cs page and the other in a regular.cs class file.
  I would like to pass two data members from the regular .cs class file to the .aspx page, however every time the "Page_Load" method fires it resets all the values that were previously passed. I tried commenting out everything in "Page_Load" and I event went as far as removing the method all together, but the parameter values are still being reset.</p>
  
  <p>Is there a way to pass these values to and maintain them? Any examples would be extremely helpful as I am lost. I looked at this <a href="https://stackoverflow.com/questions/5867259/pass-values-between-aspx-webpage-and-class">[example]</a> but was unsuccessful.</p>
  
  <p>Code for my aspx.cs page</p>
  
  <pre><code>public partial class tbIndexUI : System.Web.UI.UserControl
  {
      private int _numOfCols = 0;
      private int itemsPerCol = 0;
  
      public int numColumns
      {
          set
          {
              _numOfCols = value;
          }
      }
  
      public int itemsPerColumn
      {
          set
          {
              _itemsPerCol = value;
          }
      }
      public static void passData(int numOfCol, int itemsPerCol)
      {
          numColumns = numOfCol;
          itemsPerColumn = itemsPerCol;
      }
   }
  </code></pre>
  
  <p>Code for my regular class process.cs</p>
  
  <pre><code>void sendInformation()
  {
      tbIndexUI.passData(numOfCols, itemsPerCol);
  }
  </code></pre>