title: c# MVC: ajax beginform not working after call from ajax actionlink
body: <p><br/>
  i have problem with call ajax.actionlink.
  in <i>index</i> view i have a 2 buttons. By default is call <i>Editor</i> method in <i>TestController</i> and ajax.beginform work correctly, if i click hyperlink (ajax) to switch view and i click other hyperlink to come back to previous view with beginform, then beginform dont work. Why and how to fix that? Code is below.</p>
  
  <p>Index view</p>
  
  <pre><code>&lt;head&gt;
      &lt;meta name="viewport" content="width=device-width"/&gt;
      &lt;title&gt; Test? &lt;/title&gt;
  
      &lt;link href="~/Content/Admin/css/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
      @Ajax.ActionLink( "T1", "Editor", "Test", new AjaxOptions(){ UpdateTargetId = "ii2" } )
      @Ajax.ActionLink( "T2", "Test1", "Test2", new AjaxOptions() { UpdateTargetId = "ii2" })
  
  &lt;div id="ii2"&gt;
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Editor view</p>
  
  <pre><code>&lt;table&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt; index &lt;/th&gt;
          &lt;th&gt; name &lt;/th&gt;
          &lt;th&gt; action &lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
  
      &lt;tbody id="iTest1" &gt;
          @Html.Action( "Table", "Test" )
      &lt;/tbody&gt;
  
      &lt;tfoot&gt;
      &lt;tr&gt;
          @Html.Action( "TableAdd", "Test" )
      &lt;/tr&gt;
      &lt;/tfoot&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Table view</p>
  
  <pre><code>@using Domain.Entity
  @model IEnumerable&lt;Domain.Entity.Language&gt;
  
  @foreach (Language l in Model)
  {
      &lt;tr&gt;
          &lt;td&gt; @l.Index &lt;/td&gt;
          &lt;td&gt; @l.Name &lt;/td&gt;
          &lt;td&gt; &lt;/td&gt;
      &lt;/tr&gt;
  }
  </code></pre>
  
  <p>TableAdd view</p>
  
  <pre><code>@model Domain.Entity.Language
  @using (Ajax.BeginForm( "Add", "Test", new AjaxOptions() { UpdateTargetId = "iTest1" }))
  {
      &lt;th&gt; @Html.TextBoxFor(x =&gt; x.Index) &lt;/th&gt;
      &lt;th&gt; @Html.TextBoxFor(x =&gt; x.Name) &lt;/th&gt;
      &lt;th&gt; &lt;input type="submit" value="submit"/&gt; &lt;/th&gt;
  }
  </code></pre>
  
  <p>Test controller</p>
  
  <pre><code>public class TestController : Controller
  {
      private ILanguageRepository _repository = null;
  
      public TestController(ILanguageRepository repository)
      {
          _repository = repository;
      }
  
      public ActionResult Index()
      {
          return View( );
      }
  
      public ActionResult Editor()
      {
          return PartialView( "Editor" );
      }
  
      public ActionResult Add(Language l)
      {
          _repository.Add( l, true );
          return Table();
      }
  
      public ActionResult Table(IEnumerable&lt;Language&gt; items = null)
      {
          if (items == null)
              items = _repository.Languages;
          return PartialView( "Table", items );
      }
  
      public ActionResult TableAdd( Language item )
      {
          return PartialView("TableAdd", item);
      }
  }
  </code></pre>