title: Binding client side event to dyanamic datalist items using jquery
body: <p>I got stuck in a problem. I am loading elements in a datalist dynamically. and i am trying to bind click event on a column using jquery. It works fine when i use master page with it. as it follows the page life cycle and loading jquery after child page data binding. But when i use it in a normal page(without master page) it does not allow me to perform desired action. I know why is this happening, the reason is jquery is being loaded before elements binding. so jquery is not able to bind click event since it is not able to find those controls. </p>
  
  <p><strong>binding elements already have "item" class in them</strong></p>
  
  <p>here is my jquery code:</p>
  
  <pre><code>$(document).ready(function () {
      $('.item').click(function () {
            //do something here
     });
  });
  </code></pre>
  
  <p>code behind:</p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
   {
       using (TestEntites db = new TestEntites())
      {
          IEnumerable&lt;Template&gt; Test = from t in db.Template
                                                      where t.Customer == clsuser.CustomerID
                                                          &amp;&amp; t.Region == user.RegionID
                                                      select t;
  
          dlTemplateGroups.DataSource = Test;
          dlTemplateGroups.DataBind();
  
          BindTemplates(db);
      }     
   }
  </code></pre>