title: How to get a HTML submit button in an ASP.NET page to call a controller method in MVC controller class
body: <p>I am building an ASP.NET MVC web application and I want to get a HTML submit button in one webpage to access a post controller method in my controller class, and finally link to another page on the site such as Profile.aspx through this controller method. My current situation is as follows: </p>
  
  <p>I have a HTML webpage that is my index view as follows:</p>
  
  <pre><code>&lt;div&gt;
      &lt;h1&gt;Login&lt;/h1&gt;
      Username&lt;br/&gt;
      &lt;input id="Text1" type="text" /&gt;&lt;br /&gt;
      &lt;br /&gt;
      Password&lt;br/&gt;
      &lt;input id="Password1" type="password" /&gt;&lt;br /&gt;
      &lt;br /&gt;
      &lt;input id="Submit1" type="submit" value="Login" /&gt;&lt;br /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I hit the login button I want to link to a LogIn() method in my controller class and subsequently redirect to a page, my LogIn controller looks like this : </p>
  
  <pre><code>[HttpPost]
  public ActionResult LogIn()
  {
      return View();
  }
  </code></pre>
  
  <p>How do I access this method of the controller through the button and how do I redirect to another page?</p>
  
  <p>All help is appreciated! :)</p>