title: Getting Data from Repeater
body: <p>Basically the question is:</p>
  
  <p>how do i get the ImageID from a repeater so that i can pass it with a query string on button click? </p>
  
  <p>For example: i need to edit a Image Details , each image have a edit button </p>
  
  <p>As shown below:( generated by repeater)</p>
  
  <p><img src="https://i.stack.imgur.com/88NOD.png" alt="enter image description here"></p>
  
  <p>c# code:</p>
  
  <pre><code>var List = new List&lt;Images&gt;();
                  foreach (DataRow dr in picture.Rows)
                  {
                      DateTime DateTemp =            DateTime.Parse(dr["date"].ToString());
                      var childPhoto = new Images()
                                 {
                                      DateTaken = DateTemp.ToString("MM/dd/yyyy"),
                                      PlaceTaken = dr["place"].ToString(),
                                      DetailedInfo = dr["info"].ToString(),
                                      ImageID = dr["ImageId"].ToString()
                                 };
                      childList.Add(childPhoto);
                  }
  
                  ShowPhotoRepeater.DataSource = List;
                  ShowPhotoRepeater.DataBind();
              }
          }
      }
  
      protected void btnEditChildPhoto_Click(object sender, EventArgs e)
      {
  
          Response.Redirect("EditPhoto.aspx?ImageID=" + ));
      }
  </code></pre>
  
  <p>My aspx code:</p>
  
  <pre><code> &lt;asp:Repeater ID="ShowProfileRepeater" runat="server"&gt;
      &lt;ItemTemplate&gt;
      &lt;table&gt; 
          &lt;tr&gt;
              &lt;td width = "15%" rowspan="6"&gt;&lt;%--&lt;asp:Image ID="ImgPhoto" runat=server /&gt;--%&gt; 
              &lt;%--&lt;asp:Image ID="childImage" ImageUrl="&lt;%#Eval("ImgUrl")%&gt;" runat="server" /&gt;--%&gt;  
              &lt;asp:Image ID="childImage" ImageUrl="~/img/missing children pictures/shearwey.jpg" CssClass="content_image" runat="server" /&gt; 
              &lt;/td&gt;&lt;br /&gt;
              &lt;td width = "15%"&gt;Name:&lt;/td&gt;
              &lt;td width = "70%"&gt;
                  &lt;asp:Label ID="lblChildName" runat="server" Text='&lt;%#Eval("Name")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/td&gt;
              &lt;td &gt;
                  &lt;asp:Button ID="btnEditChildProfile" runat="server" Text="Edit"   /&gt;
              &lt;/td&gt;
  
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width = "15%"&gt;Gender:&lt;/td&gt;
              &lt;td width = "55%"&gt;
                  &lt;asp:Label ID="lblChildGender" runat="server" Text='&lt;%#Eval("Gender")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width = "10%"&gt;Date Of Birth:&lt;/td&gt;
              &lt;td width = "55%"&gt;
                  &lt;asp:Label ID="lblChildDOB" runat="server" Text='&lt;%#Eval("DOB")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/td&gt;                                  
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width = "10%"&gt;Country:&lt;/td&gt;
              &lt;td width = "55%"&gt;
                  &lt;asp:Label ID="lblChildCountry" runat="server" Text='&lt;%#Eval("Country")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/td&gt;                                  
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width = "10%"&gt;Missing Date:&lt;/td&gt;
              &lt;td width = "55%"&gt;
                  &lt;asp:Label ID="lblChildMissingDt" runat="server" Text='&lt;%#Eval("MissingDt")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/td&gt;                                  
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width = "10%"&gt;Last Seen Location:&lt;/td&gt;
              &lt;td width = "55%"&gt;
                  &lt;asp:Label ID="lblChildLaseSeenLoc" runat="server" Text='&lt;%#Eval("LastSeenLoc")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/td&gt;                                  
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
  
      &lt;/table&gt;
      &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt; 
  </code></pre>