1
2
3
4
5
6
7
8
9
10
///aspx///
<asp:Repeater ID="rpt" runat="server">
     <ItemTemplate>
          <tr>
               <td>
                    <%# GetRowIndex(Container.ItemIndex) %>
               </td>
          </tr>
     </ItemTemplate>
</asp:Repeater>
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
///aspx.cs///
protected int pageno = 1;
protected int pagesize = 10;
protected int totalcount = 0;  // DB 총 갯수
 
protected string GetRowIndex(int itemindex)
{
    string value = string.Empty;
 
    int startindex = totalcount - ((pageno - 1* pagesize);
 
    int rowindex = startindex - itemindex;
 
     value = Convert.ToString(rowindex);
 
    return value;
}
cs


'프로그래밍 노트 > ASP.NET' 카테고리의 다른 글

동적 배열 생성하는 법  (0) 2015.01.09
사이즈 자동 증가하는 배열 만들기  (0) 2015.01.08
웹 폼 이벤트 처리 순서  (0) 2014.04.25
Cookie (쿠키)  (0) 2014.04.25
ViewState (뷰 스테이트)  (0) 2014.04.25

+ Recent posts