title: No data displayed
body: <p>I am trying to display data, sent from an <code>.ashx</code> file in JSON format, using <code>jsrender</code>. How do you convert data in a <code>List&lt;&gt;</code> collection to JSON in <code>ashx</code> file and render it in the client using <code>jsrender</code>?  Here is the code I am using:    </p>
  
  <p>Handler(.aspx) file:</p>
  
  <pre><code>List&lt;repo1&gt; listRec = new List&lt;repo1&gt;();
  
  OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
  while (dr.Read()) {
     repo1 objRec = new repo1(dr.GetString(0), dr.GetString(1));
     listRec.Add(objRec);
  }
  String ex = javaScriptSerializer.Serialize(listRec);
  context.Response.Clear();
  context.Response.ContentType = "application/json";
  context.Response.Write(ex);
  </code></pre>
  
  <p>Client side:</p>
  
  <pre><code>function getDetails(va){
      $.ajax({
          url: "bll_data.ashx",
          contentType: "application/json; charset=utf-8",                 
          data: { "ex": va, "method": '3' },
          dataType: "json",
          success: displayReport,
          error: OnFail
      });            
  }
  function displayReport(dataobt){  
      $("#exg").html($("#ExgTemplate").render(dataobt));
  }
  </code></pre>
  
  <p>if I can get the <code>dataobt</code> in this format in client side:</p>
  
  <pre><code>[{ ecode: "1", "ename": "xxxx" },
          { ecode: "2", "Name": "yyyy" },
          { ecode: "3", "Name": "zzzz" }
  ]
  </code></pre>
  
  <p>The displayReport(dataobt) function <a href="http://weblogs.asp.net/stevewellens/archive/2011/11/09/goodby-jquery-templates-hello-jsrender.aspx" rel="nofollow">will work</a> the output( <code>alert(dataobt);</code> ) I am getting now in the client side is a series of "[object Object],[object Object]...". I think objects are being added to the <code>List&lt;&gt;</code>.</p>
  
  <p>Conversion at the client side is where I think the problem is.</p>
  
  <p>Can someone please correct the code?</p>