title: Trigger Click event on the first repeater item
body: <p>I'm making a gallery site. And it plots the available photography sessions that are on the database. </p>
  
  <p>But when the user first opens the page, no photography sessions are selected. So the page would be empty. I want to automatically select the first session for the user. I did it by selecting the first record in the database. But i really wish if i could just write a code inside the <code>Page_load</code> that auto clicks on the first item inside the repeater. </p>
  
  <p>The repeater items are dynamically generated of course. So i don't know if i could achieve this using JavaScript or not.</p>
  
  <p>Here's my code :</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
  
      DataSet dst = new DataSet();
      using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString))
      {
          SqlDataAdapter adbtr = new SqlDataAdapter();                
          adbtr.SelectCommand = new SqlCommand("SELECT * FROM dbo.Select_gallery_names_FN()", con);
          try
          {
              int result = adbtr.Fill(dst);
              if (result == 0)
              {
                  return;
              }
              cat_repeater.DataSource = dst;
              cat_repeater.DataBind();
          }
          catch(Exception ex)
          {
              Response.Write(ex.Message);
          }
  
      }
  
      using (SqlConnection img_con = new SqlConnection(ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString))
      {
          SqlDataAdapter img_adbtr = new SqlDataAdapter();
          img_adbtr.SelectCommand = new SqlCommand("select * from dbo.Select_gallery_cat_FN(@img_cat)", img_con);
          img_adbtr.SelectCommand.Parameters.Add("@img_cat",SqlDbType.NVarChar,8000).Value = dst.Tables[0].Rows[0][0].ToString();
          DataSet img_dst = new DataSet();                
          try
          {
              img_adbtr.Fill(img_dst);
              slider_repeater.DataSource = img_dst;
              slider_repeater.DataBind();
          }
          catch (Exception ex)
          {
              Response.Write(ex.Message);
          }                
      }            
  }
  
  protected void cat_repeater_ItemCommand(object source, RepeaterCommandEventArgs e)
  {
      using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString))
      {
          SqlCommand cmd = new SqlCommand();
          cmd.Connection = con;
          cmd.CommandText = "select * from dbo.Select_gallery_cat_FN(@img_cat)";
          cmd.Parameters.Add("@img_cat", SqlDbType.NVarChar,8000).Value = ((LinkButton)e.CommandSource).Text;
          con.Open();
          slider_repeater.DataSource = cmd.ExecuteReader();
          slider_repeater.DataBind();
      }
  }
  </code></pre>