title: MVC C#, Partial View, Jquery load() not working properly after .load() is called
body: <p>I am using C#, MVC. </p>
  
  <p>I am having a problem with PartialView and jquery load working properly.</p>
  
  <p>When the user clicks on a hyperlink called Kit, I call the following:</p>
  
  <pre><code>    public ActionResult KitsEdit(string id)
      {
          int idnbr = Convert.ToInt32(id);
  
          var Progs = db2.usp_KitInfo(idnbr)
                      .OrderBy(x =&gt; x.TDate).ToList();
  
  
          return PartialView(Progs);
      }
  </code></pre>
  
  <p>which loads a PartialView on the page fine. </p>
  
  <p>the View has rows and for each row has an edit hyperlink. 
  When the user clicks on the Edit hyperlink, I show a dialog box where the user can modify that some of the info on that appears on each row and hit submit. This works fine the first time. </p>
  
  <p>On submit, I call I do some validation and then call:</p>
  
  <pre><code>    $("#stlist").load('@Url.Action("KitsEdit", "Spr")' + '?id=' + '@Model.id'); 
  </code></pre>
  
  <p>as I need to reload the partial view on the page so the user can see the updated information.</p>
  
  <p>The load of the page works fine on the surface. What happens though is that when I click on Edit hyperlink a SECOND time after I did the .load and the dialogbox shows up some of the functionality that worked before simply doesn't work. For example, the checkbox doesn't work in that if I click it, the value doesn't get passes properly back to the controller action. Also, for the submit, I had some code on click but those don't even  work. It goes diectly to the controller action and bypasses all of the code in    </p>
  
  <pre><code>    $("#submit").click(function ().
  </code></pre>
  
  <p>Note that this happens only after the load() is called.</p>
  
  <p>Question: Is there anything besides the .load() that will load a PartialView on the page. If not, how can I get it to work properly with the .load().</p>
  
  <p>Below is what the submit click looks like:</p>
  
  <pre><code>    $("#submit").click(function () {
      //  following .on code won't execute code inside of function so have it commented       
      // $("#submit").on("click", function () {  
  
           var inactivedate = $("#InactiveDate").val();
  
           var inactivecheck = $('#Inactive').is(':checked');
  
           var inactivereason = $('#InactiveReason option:selected').text();
  
           if ((!inactivedate || !$.trim(inactivedate)) &amp;&amp; $('#Inactive_cb').attr('checked') == true) {
               alert('Inactive Date must be entered.');
               return false;
           }
  
           if ($('#Inactive_cb').attr('checked') == true &amp;&amp; inactivereason == '&lt;Choose&gt;') {
               alert('Inactive Reason must be selected.');
               return false;
           }
  
           var url = '@Url.Action("EditTrain", "Spr")';
  
  
           $.ajax({
               type: "POST",
               url: url,
               async: false,
               data: $('#theForm').serialize()               
             });
  
  
           $("#stlist").load('@Url.Action("kitsEdit", "Spr")' + '?id=' + '@Model.spkrid');
           parent.$.fn.colorbox.close();
  
           return false;
  
       });
   });
  </code></pre>
  
  <p>Thanks in advance.</p>