Hasan Akpürüm
Kıdemli Yazılım Danışmanı
Makele Detayı

Asp.net Repeater İçindeki Html Kontrolü

6/24/2011 9:12:39 AM
Design ----------------------------------
<asp:Repeater ID="Rep1" runat="server"> <HeaderTemplate>     <table id="Table1" class="data"> </HeaderTemplate> <ItemTemplate>     <tr id="Row" runat="server">         <td>Item #1</td>         <td><asp:LinkButton ID="LinkButton1" OnClick="DoSomething"              Text="Item #2" runat="server" /></td>     </tr> </ItemTemplate> <FooterTemplate>     </table> </FooterTemplate>
CodeBehind ----------------------------------
foreach (RepeaterItem item in Rep1.Items) {     HtmlTableRow row = item.Controls[0].FindControl("Row") as HtmlTableRow;     foreach (HtmlTableCell cell in row.Cells)     {         if (cell.InnerText != string.Empty)         {             Response.WriteLine(cell.InnerText);         }     } }
Bol klavye tıkırtılı günler  ;-)
Yorum yaz

Thanks, your message is sent successfully.