RePeater 컨트롤이란 ?? |
FrmRepeater.aspx |
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FrmRepeater.aspx.cs" Inherits="FrmRepeater" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Repeater</title> </head> <body> <form id="form1" runat="server"> <div> 리피터 컨트롤 사용 출력<br /> <br /> <asp:Repeater ID="Repeater1" runat="server" <HeaderTemplate> <%= SITE_NAME %><br /> </HeaderTemplate> <ItemTemplate> <%# Eval("Name") %><br /> </ItemTemplate> <AlternatingItemTemplate> <%# "<a href='View.aspx?Num='" + Eval("Num") + "'>" </AlternatingItemTemplate> <SeparatorTemplate> <hr /> </SeparatorTemplate> <FooterTemplate> 꼬리말 </FooterTemplate> </asp:Repeater> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Memos] ORDER BY [Num] DESC"> </asp:SqlDataSource> </div> </form> </body> </html> |
FrmRepeater.Cs |
using System;
{ public string SITE_NAME { get; set; } // 속성 public FrmRepeater() { SITE_NAME = "닷넷코리아"; } protected void Page_Load(object sender, EventArgs e) { } } |
'.Net Project > ASP.NET 3.5 Sp1' 카테고리의 다른 글
50장 상태관리(httpContext) (0) | 2009.10.27 |
---|---|
49장 추적(Trace) (0) | 2009.10.27 |
47장 데이터 컨트롤(FormView) (0) | 2009.10.27 |
46장 데이터 컨트롤(DataList) (0) | 2009.10.27 |
45장 데이터 컨트롤(GridView) (0) | 2009.10.27 |