Hasan Akpürüm
blog-post-1

Asp.net Repeater İçindeki Html Kontrolü

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