title: Asp.Net MVC3 Razor submit calling method
body: <p><strong>Hello, I'm new i mvc, I have next view</strong></p>
  
  <pre><code>@model MeterProfileData.Core.Dto.CdapiDto
  
  @{
      ViewBag.Title = "Create";
      Layout = "~/Views/SiteMaster.cshtml";
  }
  
  &lt;h2&gt;Create&lt;/h2&gt;
  
  
  @using (Html.BeginForm()) {
      &lt;fieldset&gt;
          &lt;legend&gt;Add new CDAPI&lt;/legend&gt;
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Name)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Name)
              @Html.ValidationMessageFor(model =&gt; model.Name)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Url)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Url)
              @Html.ValidationMessageFor(model =&gt; model.Url)
          &lt;/div&gt;
        &lt;p&gt;
          &lt;input type="submit"  value="Save" /&gt;
        &lt;/p&gt;
      &lt;/fieldset&gt;
  }
  &lt;div&gt;
      @Html.ActionLink("Back to List", "CdapiList")
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>and next controler</strong> </p>
  
  <pre><code>public class CdapiController : Controller
    {
      //
      // GET: /Cdapi/
  
      public ActionResult CdapiList()
      {
        var cdapiList = new CdapiService().GetListCdapiServers();
        return View(cdapiList);
      }
  
      [HttpGet]
      public ActionResult Create()
      {
        return View();
      }
  
      [HttpPost]
      public ActionResult Create(CdapiDto dto)
      {
        new CdapiService().CreateCdapi(dto);
        return RedirectToAction("CdapiList");
      }
    }
  </code></pre>
  
  <p>After submit always call first method and page refreshed. What I'm doing wrong? and what to do for calling second method and send to it parameters from page</p>
  
  <p><strong>Master Layout</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;@ViewBag.Title&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;Test mvc&lt;/title&gt;
      &lt;meta name="keywords" content="" /&gt;
      &lt;meta name="description" content="" /&gt;
      &lt;link rel="stylesheet" href="/Content/style.css" type="text/css" media="screen, projection"&gt;
      &lt;/link&gt;
      &lt;script src="@Url.Content("~/Content/javascript/jquery-1.7.1.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/jquery-jtemplates.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div id="wrapper"&gt;
          &lt;div id="header"&gt;
              &lt;h3&gt;
                  View Pages&lt;/h3&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;a runat="server" href="/Register"&gt;Registers&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a runat="server" href="/MeterProfile"&gt;Meter Profiles&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a runat="server" href="/register/SupportedRegisters"&gt;Supported Registers &lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a runat="server" href="/logers/SupportedLogers"&gt;Supported Loggers &lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a runat="server" href="/Cdapi/CdapiList"&gt;CDAPI Servers &lt;/a&gt;&lt;/li&gt;
              &lt;/u&gt;
          &lt;/div&gt;
          &lt;div id="content"&gt;
              @RenderBody()
          &lt;/div&gt;
          &lt;div id="footer"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>