title: How do I display a table of SQL data on the same page upon form submit in C#?
body: <p><strong>Scenario:</strong></p>
  <p>I have a form in in a C# page that is routed to a controller. This controller queries a MySQL database to shows all the in the database:</p>
  <pre><code>&lt;p&gt;Process an order&lt;/p&gt;
  &lt;form id=&quot;retrievePastOrders&quot; enctype=&quot;multipart/form-data&quot; action=&quot;/RetrievePastOrders&quot; method=&quot;Get&quot;&gt;
          &lt;fieldset&gt;
              &lt;br&gt;&lt;br/&gt;
                  &lt;input type=&quot;submit&quot; value=&quot;Review Past Orders&quot;&gt;
          &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  <p>This is the controller it gets to:</p>
  <pre><code> [Route(&quot;/RetrievePastOrders&quot;)]
  [ApiController]
  public class RetrieveOrderController : ControllerBase
  {
      [HttpGet]
      public ContentResult RetrievePastOrders([FromForm] Order order)
      {
          MySQLDAO mysqlDAO = new MySQLDAO();
          String resultsTable = mysqlDAO.ConnectToMySQLDatabase(order, &quot;READ&quot;);
       
          return base.Content(&quot;&lt;div&gt; &quot; + resultsTable + &quot;&lt;/div&gt; &quot;, &quot;text/html&quot;);
      }
  }
  </code></pre>
  <p><strong>Question:</strong></p>
  <p>This returns a page that just shows a table I built of all the all SQL data, but how do I get it so that this data just appears on the same page as the form? Is that possible?</p>
  <p>I've tried looking at the docs for base.Content and seeing if people did similar things online, but all the examples were for C# MVC and I couldn't seem to get anything to work.</p>