title: C# Sudoku Puzzle
body: <p>Hi All I'm trying to create a sudoku puzzle using classes, arrays, and for loops. Pretty much wanting to generate the puzzle from the code behind aspx. The problem that I'm running into is how to display the contents of a for loop that creates an array of the textboxes.</p>
  
  <p>I have a class called sTextBox.cs that creates a textbox and contains the other features of the puzzle. Then I have a class puzzleBox.cs that creates an array of sTextBox. This is the inside of a single square of the puzzle. Then I have the Puzzle class that creates an array of the Box(). This way it should create all the textboxes needed for a puzzle. What I simply am trying to figure out is how to get the puzzle to display on the aspx. </p>
  
  <p>Code:</p>
  
  <p>sTextBox.cs</p>
  
  <pre><code>public STextBox()
  {
      txtBox = new System.Web.UI.WebControls.TextBox();
  
  }
  
  
  public System.Web.UI.WebControls.TextBox getTextBox()
  {
      return txtBox;
  }
  </code></pre>
  
  <p>Box.cs</p>
  
  <pre><code>private SodokuTextBox[,] sTBox;
  
  public Box()
  {
      sTBox = new SodokuTextBox[3,3];
  
      for (int i = 0; i &lt; 3; i++ )
      {
          for (int j = 0; j &lt; 3; j++ )
          {
              sTBox[i, j] = new SodokuTextBox(); // make new sodoku textbox
          }
      }
  }
  </code></pre>
  
  <p>puzzle.cs</p>
  
  <pre><code>{
  
  
  private Box[,] boxArray;
  
  
  public Puzzle()
  {
      boxArray = new Box[3, 3];
  
      for (int i = 0; i &lt; 3; i++)
      {
          for (int j = 0; j &lt; 3; j++)
          {
  
              boxArray[i, j] = new Box(); // make new sodoku textbox
  
  
  
  
          }
      }
  </code></pre>
  
  <p>I've been trying to insert things into a table somehow but all the methods that I found didn't seem to work for me. Thanks for any help!!</p>
  
  <p>EDIT:</p>
  
  <p>Ok so after working through things a little further I think what I need to do is to somehow put the individual textboxes in a table cell then have the table be the bigger (square of 9) then put the big table into another table cell within the puzzle (square of 81) Not sure if this is the best way to approach this or how to really do this if at all possible.</p>