title: ASP.NET MVC Render Form With Route Values
body: <p>The route for my view is like this:</p>
  
  <pre><code>http://localhost/project1/join/register/ABCDEFGH/12345678
  </code></pre>
  
  <p>The last two parts are the parameters which I accept as part of my route. What I want to do now is to render a form onto the view which has a post method which retains that url.</p>
  
  <p>I am using the BeginForm HTML helper as follows:</p>
  
  <pre><code>using (Html.BeginForm(
      "Register", 
      "Join", 
      new { ApplicationKey = Model.ApplicationKey, UserId= Model.UserId}, 
      FormMethod.Post, 
      new { @class = "form-horizontal", @role = "form" }))
  </code></pre>
  
  <p>This renders the forms action tag with a URL as follows...</p>
  
  <pre><code>http://localhost/project1/join/register?ApplicationKey=ABCDEFGH&amp;UserId=12345678
  </code></pre>
  
  <p>Is there any way to use the form helper and to retain the format of my route? I can make this work with query string parameters but there are other considerations which mean it would be better if I could get the helper to format the route as it was originally used to access the page.</p>
  
  <p>Thanks.</p>