title: ASP.Net MVC 2 - button click on view is not calling any method in the controller? what am i missing?
body: <p>Am trying my hands on asp.net mvc2 and using mvc2 template to work upon. Following the template, i created my own model, controller and view in there respective folder locations. i also changed the default routing in global.asax for this controller and view. now my view is getting loaded but when i click on a button in my view, none of the methods i wrote in my controller is getting hit. what could be the reason, what am i missing? i also want to call a preload method from my controller, before my view is rendered. please help...am stuck.
  here is my view</p>
  
  <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage&lt;CreditCashAllocationSystem.Models.ConfigurationModel&gt;" %&gt;
  
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"&gt;
   Configuration
  &lt;/asp:Content&gt;
  
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;
  
      &lt;h2&gt;Configuration&lt;/h2&gt;
  
      &lt;% using (Html.BeginForm()) {%&gt;
          &lt;%= Html.ValidationSummary(true) %&gt;
  
          &lt;fieldset&gt;
              &lt;legend&gt;Fields&lt;/legend&gt;
  
              &lt;div class="editor-label"&gt;
                  &lt;%= Html.LabelFor(model =&gt; model.DropOffDaysForward) %&gt;
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  &lt;%= Html.TextBoxFor(model =&gt; model.DropOffDaysForward) %&gt;
                  &lt;%= Html.ValidationMessageFor(model =&gt; model.DropOffDaysForward) %&gt;
              &lt;/div&gt;
  
              &lt;div class="editor-label"&gt;
                  &lt;%= Html.LabelFor(model =&gt; model.DropOffDaysBackward) %&gt;
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  &lt;%= Html.TextBoxFor(model =&gt; model.DropOffDaysBackward) %&gt;
                  &lt;%= Html.ValidationMessageFor(model =&gt; model.DropOffDaysBackward) %&gt;
              &lt;/div&gt;
  
              &lt;div class="editor-label"&gt;
                  &lt;%= Html.LabelFor(model =&gt; model.DealDropOffDateDays) %&gt;
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  &lt;%= Html.TextBoxFor(model =&gt; model.DealDropOffDateDays) %&gt;
                  &lt;%= Html.ValidationMessageFor(model =&gt; model.DealDropOffDateDays) %&gt;
              &lt;/div&gt;
  
              &lt;div class="editor-label"&gt;
                  &lt;%= Html.LabelFor(model =&gt; model.DealHistoryDays) %&gt;
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  &lt;%= Html.TextBoxFor(model =&gt; model.DealHistoryDays) %&gt;
                  &lt;%= Html.ValidationMessageFor(model =&gt; model.DealHistoryDays) %&gt;
              &lt;/div&gt;
  
              &lt;div class="editor-label"&gt;
                  &lt;%= Html.LabelFor(model =&gt; model.UnappliedHistoryDays) %&gt;
              &lt;/div&gt;
              &lt;div class="editor-field"&gt;
                  &lt;%= Html.TextBoxFor(model =&gt; model.UnappliedHistoryDays) %&gt;
                  &lt;%= Html.ValidationMessageFor(model =&gt; model.UnappliedHistoryDays) %&gt;
              &lt;/div&gt;
  
              &lt;p&gt;
                  &lt;input type="submit" value="Create" /&gt;
              &lt;/p&gt;
          &lt;/fieldset&gt;
  
      &lt;% } %&gt;
  
      &lt;div&gt;
          &lt;%= Html.ActionLink("Back to List", "Index") %&gt;
      &lt;/div&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>and here is my controller:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  
  namespace CreditCashAllocationSystem.Controllers
  {
      public class ConfigurationController : Controller
      {
  
          //
          // GET: /Configuration/Create
  
          //will be called on Form Load
          public ActionResult Create()
          {
              return View("Configuration");
          } 
  
          //
          // POST: /Configuration/Create
  
  
          //Method will be called once u click on create/save button
          [HttpPost]
          public ActionResult Create(FormCollection collection)
          {
              try
              {
                  // TODO: Add insert logic here
  
                  return View("Configuration");
              }
              catch
              {
                  return View("Configuration");
              }
          }
      }
  }
  </code></pre>
  
  <p>and here is my Global.asax: </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using System.Web.Routing;
  
  namespace CreditCashAllocationSystem
  {
      // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
      // visit http://go.microsoft.com/?LinkId=9394801
  
      public class MvcApplication : System.Web.HttpApplication
      {
          public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
              routes.MapRoute(
                  "Default", // Route name
                  "{controller}/{action}/{id}", // URL with parameters
                  new { controller = "Configuration", action = "Create", id = UrlParameter.Optional } // Parameter defaults
              );
          }
  
          protected void Application_Start()
          {
              AreaRegistration.RegisterAllAreas();
              RegisterRoutes(RouteTable.Routes);
          }
      }
  }
  </code></pre>
  
  <p>Please help, what am i missing?</p>