title: How can I dump data on the screen in c#
body: <p>I have a query that runs and I was trying to dump the query on the screen so I can see that and paste it in my SQL server. (I used to do this in php using <code>var_dump()</code> )</p>
  
  <p>I tried using <code>Console.Write()</code> in the <code>aspx.cs</code> file. But no results in the console in dev tools on the browser.</p>
  
  <p>Here is my aspx button,</p>
  
  <pre><code>&lt;asp:Button ID="btnSearch" runat="server" Text="GetEmails" onclick="btnSearch_Click" /&gt;
  </code></pre>
  
  <p>Here is my function in the aspx.cs</p>
  
  <pre><code>protected void btnSearch_Click(object sender, EventArgs e)
  {
      string query = "select * from tbl_inst";
      string queryWhere = " where time like '" + DropDownListTime.SelectedValue + "'";
      string loc= "";
      string room = "";
  
      if (!(loc= DropDownListLoc.SelectedValue).Equals(""))
      {
          queryWhere = " where (location1 like '" + loc + "%' or location2 like '" + loc + "%' or location3 like '" + loc + "%' or location4 like '" +
              loc + "%') and time like '" + DropDownListTime.SelectedValue + "'";
      }
      if (!(room = DropDownListRoom.SelectedValue).Equals(""))
      {
          queryWhere = " where (location1 like '" + room + "' or location2 like '" + room + "' or location3 like '" + room + "' or location4 like '" +
              room + "') and time like '" + DropDownListTime.SelectedValue + "'"; 
      }
      if (queryWhere.Contains("like ''")) { queryWhere = " where time is null"; }
      query += queryWhere; 
      SqlDataSource1.SelectCommand = query;
  }
  </code></pre>
  
  <p>Basically I want to see the values any variables here on the screen.</p>
  
  <pre><code>Console.WriteLine(room);
  Console.WriteLine("TEST" + queryWhere);
  </code></pre>
  
  <p>etc..</p>