title: Passing control id to javascript from code behind
body: <p>I am making a dynamic image gallary in which images of a folder are listed in div.<br>
  I want to increase there size on onclick by javascript.</p>
  
  <p>I am assigning onclick event from code-behind like this</p>
  
  <pre><code>   int count = ds.Tables[0].Rows.Count; ;
               for (int i = 0; i &lt; count; i++)
              {
                  ImageButton img = new ImageButton();
                  img.ID = "projectimg" + i.ToString();
                  img.ImageUrl = ds.Tables[0].Rows[i][0].ToString();
                  img.Height = 120;
                  img.Width = 120;
                  img.ToolTip = ds.Tables[0].Rows[0][1].ToString();
                  img.OnClientClick = "incsize('" + "contentPlace_" + img.ID + "')";
                }
  </code></pre>
  
  <p>where incsize is my function in JavaScript</p>
  
  <pre><code>function incsize(imgid)
  {
      alert("jjj");
      //do some thing here as
      var img = document.getElementById(imgid);
  }
  </code></pre>
  
  <p>But this is not working. What is wrong with this code?</p>