title: How to get row count in asp.net and transfer asp.net row count to javascript?
body: <p>I'm trying to get the value of an asp.net variable to javascript. Firstly, i wanted to get the number of rows in my database using asp.net and entity framework. Here is the query:</p>
  
  <pre><code>getRowCountThmb = (from g in obj.thumbnailImages where g.instrumentItem.brand.name == stringInstrumentName &amp;&amp; g.instrumentItem.model == stringInstrumentModel select g).Count();
  </code></pre>
  
  <p>And then, the retrieved row count will be passed on to the getRowCountThmb property which is like this(auto-implemented): <strong>public int getRowCountThmb { get; set; }</strong>. And after that, i will get the value of getRowCountThmb in javascript like this: <strong>var srcArray = "&lt;%= getRowCountThmb %>";</strong></p>
  
  <p>The problem is, I have found out that the getRowCountThmb is not actually getting any row count in the database. The value is 0. Resulting to a NaN value in the javascript variable called scrArray. Kindly give advice or provide solutions for this. </p>