title: DNN MVC Template - Is there a good documentation on how to develop modules
body: <p>I have been struggling from last 2 days to find clear and exemplified documentation on how to build modules using MVC framework for DOTNETNUKE CMS.</p>
  
  <p>It is very unfortunate for a CMS of that size to first advertise app developers that they support MVC, and then have next to negligible information on how to build say a very simple form to begin with.</p>
  
  <p>This is what I have achieved by now. I am trying to build a basic contact us form:</p>
  
  <ol>
  <li><p>Set up Controller Actions</p>
  
  <pre><code>// GET: FormEntry Index .. 
  [ModuleAction(ControlKey = "Add", TitleKey = "AddItem")]
  public ActionResult Index()
  {
      return View();
  }
  
  
  
  [HttpPost] // POST: 
  [ActionName("FormEntry")]
  
  public string Post(FormEntry formEntry)
  {
      try
      {
          if (ModelState.IsValid)
          {
              FormEntryManager.Instance.CreateItem(formEntry);
          }
          return "success";
      }
      catch(Exception ex)
      {
          return "error";
      }
  
  }
  </code></pre></li>
  <li><p>Set up a View.</p>
  
  <pre><code>&lt;div id="Item-@Dnn.ModuleContext.ModuleId"&gt;
  
      &lt;form id="formcontactus"&gt;
          @*@Html.ValidationSummary(true)*@
  
          &lt;fieldset&gt;
              &lt;div class="dnnFormItem"&gt;
                  &lt;div&gt;&lt;label for="itemName"&gt;@Dnn.LocalizeString("lblName")&lt;/label&gt;&lt;/div&gt;
                  @Html.TextBoxFor(m =&gt; m.VisitorName)
                  @Html.ValidationMessageFor(m =&gt; m.VisitorName, @Dnn.LocalizeString("VisitorNameRequired"))
              &lt;/div&gt;
              &lt;div class="dnnFormItem"&gt;
                  &lt;div&gt;&lt;label for="itemDescription"&gt;@Dnn.LocalizeString("lblVisitorEmail")&lt;/label&gt;&lt;/div&gt;
                  @Html.TextBoxFor(m =&gt; m.VisitorEmail)
                  @Html.ValidationMessageFor(m =&gt; m.VisitorEmail, @Dnn.LocalizeString("VisitorEmailRequired"))
              &lt;/div&gt;
              &lt;div class="dnnFormItem"&gt;
                  &lt;div&gt;&lt;label for="itemDescription"&gt;@Dnn.LocalizeString("lblPhone")&lt;/label&gt;&lt;/div&gt;
                  @Html.TextBoxFor(m =&gt; m.VisitorPhone)
              &lt;/div&gt;
              &lt;div class="dnnFormItem"&gt;
                  &lt;div&gt;&lt;label for="itemDescription"&gt;@Dnn.LocalizeString("lblMessage")&lt;/label&gt;&lt;/div&gt;
                  @Html.TextAreaFor(m =&gt; m.VisitorMessage)
                  @Html.ValidationMessageFor(m =&gt; m.VisitorMessage, @Dnn.LocalizeString("VisitorMessageRequired"))
              &lt;/div&gt;
  
              @Html.HiddenFor(m =&gt; m.ModuleId)
          &lt;/fieldset&gt;
  
          &lt;button id="btnSumbit" type="button" class="dnnPrimaryAction"&gt;@Dnn.LocalizeString("Submit")&lt;/button&gt;
          &lt;a id="cancelEdit" href="#" class="dnnSecondaryAction"&gt;@Dnn.LocalizeString("Cancel")&lt;/a&gt;
      &lt;/form&gt;
  
  &lt;/div&gt;
  </code></pre></li>
  </ol>
  
  <p>My index view does get rendered successfully, and I can see my form. Issue is in understanding the way in which I post this data to the MVC Post method. Also my data annotations for validations on my modal class does not work on client side.</p>
  
  <p>I tried posting through jQuery Ajax on the Post method, but that throws an internal error. </p>
  
  <p>Looking forward to hear from DNN community.</p>