Help on Set Values in to textboxes using $getJson in MVC??

Help on Set Values in to textboxes using $getJson in MVC??

Hi,

  1. $("#btnAutoGenerate").click(function() {    
  2.               $.getJSON("<%=Url.Action("GetAutoGenerateCode")%>",function (data) {    
  3.                        if (data) {    
  4.                         $("#txtAutoGenerate1").val(data[0]);  
  5.                      }    
  6.                       });    
  7.         });    
  8.     
  9.     
  10. In controller:    
  11.     
  12.  <AcceptVerbs(HttpVerbs.[Get])> _    
  13.     Function GetAutoGenerateCode() As ActionResult    
  14.         Dim arrCode As New ArrayList    
  15.         Dim alngCodeMaxLength = Session("CodeMaxLength")    
  16.         Dim ResetPassword As New ResetPassword    
  17.         Try    
  18.             arrCode = ResetPassword.GenerateRandomCode(alngCodeMaxLength)    
  19.            Return Json(arrCode, JsonRequestBehavior.AllowGet)    
  20.     
  21.         Catch ex As Exception    
  22.             Throw ex    
  23.         End Try    
  24.     End Function    
  25.      
  26.   
  27. If i keep or  remove this line   $("#txtAutoGenerate1").val(data[0]); even though iam  
  28. getting this pop up, this pop up i am attaching here...