title: MVC: Submitting a view to itself - avoid model property values in return URL
body: <p>I’m new to MVC and I would like to create a simple view that allows a user to enter some data => submit the form => perform some calculation on the server => and post back a model with the calculated data to the same view.
  I found a way to make it work, but I’m not sure if this is the best way to do it and what bothers me is that after the submit, all the data from the model properties are visible in the browser address bar : 
  <a href="http://localhost:53718/?Number=4&amp;Result=16" rel="nofollow noreferrer">http://localhost:53718/?Number=4&amp;Result=16</a></p>
  
  <p><strong>Here is the code for a very simplified szenario:</strong></p>
  
  <p><em>The Model:</em></p>
  
  <pre><code>public class CalculationModel
  {        
      public int Number { get; set; }        
      public int Result { get; set; }
  }
  </code></pre>
  
  <p><em>The Controler:</em></p>
  
  <pre><code>public class HomeController : Controller
  {
      public ActionResult Index(CalculationModel model)
      {
          return View(model);
      }
  
      [HttpPost]
      public ActionResult Calculate(CalculationModel model)
      {
          model.Result = model.Number * model.Number;
          return RedirectToAction("Index", "Home", model); 
      }
  }
  </code></pre>
  
  <p><em>The View:</em></p>
  
  <pre><code>        @model WebApplication1.CalculationModel
  
      @{
          ViewBag.Title = "Home Page";
      }
  
      &lt;h2&gt;Simple Calculation&lt;/h2&gt;
  
      @using (Html.BeginForm("Calculate", "Home", FormMethod.Post)){
  
          &lt;div class="form-horizontal" data-crypto-conversion-form&gt;
              &lt;div class="form-group"&gt;
                  &lt;div class="input-group"&gt;
                      @Html.EditorFor(model =&gt; model.Number, new { htmlAttributes = new { @class = "form-control " } })
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;div class="input-group"&gt;
                      @Html.EditorFor(model =&gt; model.Result, new { htmlAttributes = new { @class = "form-control " } })
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;input type="submit" value="Convert" class="btn btn-primary btn-sm submitConversion" /&gt;
              &lt;/div&gt;
  
          &lt;/div&gt;
      }
  </code></pre>
  
  <p>I’m not sure if it’s a good idea to do a RedirectToAction from the HttpPost method: return RedirectToAction("Index", "Home", model); - are there any better ways ?</p>
  
  <p>Is there any way to prevent the model property values from displaying in the url / browser address bar ?</p>
  
  <p>Thanks a lot for your help.</p>