title: Bind textbox with response from onclick event - jquery
body: <p>I have a textbox in my view page. when i click on imageIcon,it will take data from db and return in alert successfully. But, when i try to bind this response data to textbox, it is not binded correctly. My code in view page is as following :</p>
  
  <pre><code>@foreach (var dateitem in list)
                      {                        
                              &lt;td id="HoursTxt"&gt;
                                  @Html.TextAreaFor(modelitem =&gt; dateitem.Hours, new { id = string.Format("txtHours"), style = "width:50%;height:70%;" }) 
                                  @Html.Hidden("CuDate", dateitem.Date)
                                      &lt;img src="~/Images/comment.png" class="prevtest" /&gt;
                                  &lt;div style="border:solid;display:none;"&gt;                                   
                                      &lt;input type="text" id="TxtNotess" /&gt;
                                      &lt;input type="button" id="BtnComment" value="Save" /&gt;
                                  &lt;/div&gt;
                              &lt;/td&gt;
               }
  </code></pre>
  
  <p>In my onclick event of imageIcon jquery is following:</p>
  
  <pre><code>$('.prevtest').on('click', function () {        
          var Cudate = $(this).prev('#CuDate').val();
          var ProjId = parseInt($(this).parents('tr').find('input[type="hidden"]').val());
          var TskId =parseInt($(this).parents('tr').find('td').find('#testTaskId').val());       
          $.ajax({
              type: "POST",
              url: "/Timesheet/GetComments?ProjectId=" + ProjId + "&amp;TaskId= " + TskId + "&amp;date= " + Cudate,
              success : function(data)
              {
                  alert(data);
                  $('#TxtNotess').val(data);
                  alert('success');
              },
              error:function()
              {
                  alert('Error');
              }
          });
          $(this).next().toggle();
      });
  </code></pre>
  
  <p>the text box with id TxtNotess not bind with response value
  Can anyone help me to do this..
  Thanks in advance..</p>