title: ASP.NET MVC 3 RAZOR : How to use POST, it gives error "Resource can not found"
body: <p>Following are controller and view. When [submit] button is being click application raises a error "resource can not found". I know using Get and Post is very basic concept of MVC. Would any make me the concept clear with some practical scenario when to use Get and Post and WHAT IS WRONG WITH FOLLOWING CODES.</p>
  
  <h1>Controller:</h1>
  
  <pre><code>namespace MVCModelBinding.Controllers
  {
      public class HomeController : Controller
      {
          public ActionResult Index()
          {
              return View();
          }
          [HttpPost, ActionName("Index")] 
          public ActionResult IndexPost()
          {
              if (Request.Form.Count &gt; 0)
              {
  
                  string id = Request.Form["ID"];
  
                  string fname = Request.Form["FirstName"];
  
                  string lname = Request.Form["LastName"];
  
                  ViewBag.StatusMessage = "Employee data received successfully for ID " + id + "!";
  
              }
  
              return View();
          }
          public ActionResult About()
          {
              return View();
          }
      }
  }
  </code></pre>
  
  <h1>view (index.chtml)</h1>
  
  <pre><code>@using (Html.BeginForm("IndexPost", "HomeController",FormMethod.Post))
  {
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  Employee ID
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.TextBox("ID")
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  First name
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.TextBox("FirstName")
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  Last Name
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.TextBox("LastName")
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td colspan="2"&gt;
                  &lt;input type="submit" value="Submit" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  }
  </code></pre>
  
  <p>Thanks</p>
  
  <p>Paul</p>