title: Ajax Request that Post back a new page instead of loading partial
body: <p>I have this HTML code in my view</p>
  
  <pre><code>@using (Ajax.BeginForm("AddJoke", "Home", new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "MyfriendsJokes" , InsertionMode= InsertionMode.InsertAfter}))
  { 
      &lt;div style="display:block"&gt;
          &lt;textarea placeholder="Post New Joke" id="newJoke" name="joke" rows="3" cols="50" style="float:left;position"&gt;&lt;/textarea&gt;
          &lt;button type="submit" id="postnewjoke" style="float:left"&gt; Post &lt;/button&gt;
  
          @Html.TextBoxFor(model =&gt; model.fileContent, new { type = "file", id = "fileuploaded", name = "fileuploaded" })
          &lt;div style="display:inline-block"&gt;
              &lt;input type="checkbox" name="geo" id="geo" style="width: 100%; float: left; display: block"&gt;
              &lt;input name="longitude" style="display:none"/&gt;
              &lt;input name="latitude" style="display:none" /&gt;
              &lt;input name="user" style="display:none" value="@Model.user.Id"/&gt;
              &lt;span&gt;Include Location&lt;/span&gt;
          &lt;/div&gt;
          &lt;span id="jokeError" style="color:red;font-size:14px;"&gt;&lt;/span&gt;
      &lt;/div&gt;
  }
  
  
  &lt;article id="MyfriendsJokes"&gt;
      @Html.Partial("_NewJoke")
  &lt;/article&gt;
  </code></pre>
  
  <p>and this code in my controller </p>
  
  <pre><code>       [HttpPost]
      public PartialViewResult AddJoke(string joke, string user, HomePage page,HttpPostedFileBase fileuploaded, string longitude, string latitude)
      {
  
          Joke newJ = new Joke();
          newJ.Key = Guid.NewGuid();
          newJ.body = joke;
          newJ.facebookID = user;
          newJ.rank = 0;
          newJ.time = DateTime.Now;
          newJ.longitude = longitude;
          newJ.latitude = latitude;
          db.Jokes.Add(newJ);
          HomePage page1 = new HomePage();
          page1.user = Session["user"] as MyAppUser;
          //db.SaveChanges();
          return PartialView("_NewJoke", page1);
      }
  </code></pre>
  
  <p>but instead of adding elements to the targeted div, it reload the page with a new whole page with just the elements of the partial view which is this</p>
  
  <pre><code>@using Jokes.Models
  @using Microsoft.AspNet.Mvc.Facebook.Models
  @model HomePage
  
  &lt;div style="display:block"&gt;
      @Model.user.Name
  &lt;/div&gt;
  </code></pre>
  
  <p>can someone help and say what's wrong here to append elements to div instead of loading a new whole page?</p>