title: Is it possible to construct a link, navigate to it and print the response in C# programmatically? How?
body: <p>I have a webpage written in C#/Razor. I am printing all the values from a database on this page like so : </p>
  
  <pre><code>&lt;div style="min-height: 150px; font-size: 1.25em"&gt;
      &lt;div style="margin-bottom: .5em"&gt;
          &lt;table&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Branch&lt;/th&gt;
                      &lt;th&gt;Phone No.&lt;/th&gt;
                      &lt;th&gt;Extension&lt;/th&gt;
                      &lt;th&gt;Email&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                  @foreach (var prod in Model)
                  {
                      &lt;tr&gt;
                          &lt;td&gt;@prod.FullName&lt;/td&gt;
                          &lt;td&gt;@prod.Branch&lt;/td&gt;
                          &lt;td&gt;@prod.PhoneNo&lt;/td&gt;
                          &lt;td&gt;@prod.Extension&lt;/td&gt;
                          &lt;td&gt;@prod.Email&lt;/td&gt;
                          @if (User.IsInRole(@"Admins") || User.Identity.Name == prod.DomainAC)
                          {
                              &lt;td&gt;&lt;a href="/home/edit/@prod.Id"  style="color: blue;"&gt;edit&lt;/a&gt;&lt;/td&gt;
                          }
                          else
                          {
                              &lt;td&gt;User =&gt; @User.ToString()&lt;/td&gt;   
                          }
                          &lt;td&gt;
                              &lt;input type="checkbox" name="message" value="@prod.PhoneNo"&gt;Message&lt;br&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  }
              &lt;/tbody&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This works fine to display their info. What I would like to do now is a small bit more difficult.</p>
  
  <p>Below this, I have a form with a username, password and message. Using this form, I would like to have the behaviour that on submit, it will take the values in the input boxes of the form and the above C#, construct a link, navigate to the link and print the response of the server</p>
  
  <p>So I have : </p>
  
  <pre><code>@{if (IsPost)
    {
       //handle and print response
    }
    else
    {
      &lt;form method="post" action=""&gt;
          Username:&lt;br /&gt;
          &lt;input type="text" name="u" /&gt;&lt;br /&gt;
          Password&lt;br /&gt;
          &lt;input type="text" name="p" /&gt;&lt;br /&gt;
          &lt;br /&gt;
          Password&lt;br /&gt;
          &lt;textarea name="m" cols="25" rows="5"&gt;
          Enter your comments here...
          &lt;/textarea&gt;&lt;br&gt;
          &lt;br /&gt;
          &lt;input type="submit" value="Submit" class="submit" /&gt;//when this is clicked, construct url and navigate to it.
      &lt;/form&gt;
     }
  }
  </code></pre>
  
  <p>The URL I want to construct from this form is : </p>
  
  <pre><code>http://webaddress.com/web/d.php?u=&lt;Username entered by user&gt;&amp;p=&lt;Password entered by user&gt;&amp;s=&lt;List of Phone Numbers from the C# above where the checkbox is selected, comma separated&gt;&amp;m=&lt;Comment submitted by user&gt;
  </code></pre>
  
  <p>So, if my name is "John", Password is "Password1", Comment is "Test" and I have selected one checkbox for a user with the phone number "12345678", the URL I will navigate to is : </p>
  
  <pre><code>http://webaddress.com/web/d.php?u=John&amp;p=Password1&amp;s=12345678&amp;m=Test
  </code></pre>
  
  <p>Ideally I would like to print the response of the webpage in a <code>&lt;div&gt;</code> while still on the same parent web page rather than going to a new one if this is possible.</p>
  
  <p>I have no idea where to begin with this, how to do it or even if this is possible. Can anyone help me please ?</p>
  
  <p>UPDATE  :</p>
  
  <p>Trying this JQuery which does not alert me so I cannot debug : </p>
  
  <pre><code>    &lt;script&gt;
          $("#thebutton").click(function() {
              var form = $(document.getElementById('FormID'));
              var urlToConstruct = 'http://webaddress.com/web/d.php';
              urlToConstruct += '?u=' + form.find('#u').val();
              urlToConstruct += '&amp;p=' + form.find('#p').val();
              ('#employeeTable tbody tr').has(':checkbox:checked').find('td:eq(2)').each(function() {
                  urlToConstruct.append($(this).text());
                  alert(urlToConstruct);
              })
          });
   &lt;/script&gt;
  </code></pre>