Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieve Data from Repeater item
    primarykey
    data
    text
    <p>I have the following Repeater:</p> <pre><code>&lt;asp:Repeater ID="RptLeaveRequests" runat="server" onitemdatabound="RptLeaveRequests_ItemDataBound"&gt; &lt;ItemTemplate&gt; &lt;table id="tableItem" runat="server"&gt; &lt;tr&gt; &lt;td style="width: 100px;"&gt; &lt;asp:Label ID="lblDate" runat="server" Text='&lt;%#Eval("Date", "{0:dd/M/yyyy}") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td style="width: 100px;"&gt; &lt;asp:Label ID="lblHours" runat="server" Text='&lt;%#Eval("Hours") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td style="width: 200px;"&gt; &lt;asp:Label ID="lblPeriod" runat="server" Text='&lt;%#Eval("AMorPM") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td style="width: 200px; font-size:10px;"&gt; &lt;asp:Label ID="lblNote" runat="server" Text='&lt;%#Eval("Note") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td style="50px"&gt; &lt;asp:RadioButtonList ID="rbtVerified" runat="server" &gt; &lt;asp:ListItem Value="1"&gt;Accept&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="2"&gt;Reject&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="txtNotes" runat="server" &gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>Am I trying to loop through each item, find one where the radio button is checked. If a radio button is checked i want to then check its value (Accept or Reject) and retrieve the data (Eval Date,Hours etc) and send it to another method to add to the database. Can you please help me out, code so far:</p> <pre><code>protected void btnSubmit_Click(object sender, EventArgs e) { foreach (RepeaterItem item in RptLeaveRequests.Items) { } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload