제목 : 이전 10개 / 다음 10개 페이징 처리 메서드
    
    
        
            
                | 글번호: |  | 251 | 
            
                | 작성자: |  | 레드플러스 | 
            
                | 작성일: |  | 2008/07/07 오전 11:41:00 | 
            
            
                | 조회수: |  | 7260 | 
            
        
     
 
    
	
	
    
	    //[!] 페이징 처리 메서드
    /// <param name="PageNo">몇번째 페이지</param>
    /// <param name="NumPage">총 페이지 수</param>
    private void AdvancedPaging(int PageNo, int NumPage)
    {
        ++PageNo;
        int i = 0;
        string strPage = "<!--이전 10개, 다음 10개 페이징 처리 시작--><font style=\"font-size: 9pt;\"><font color=\"#c0c0c0\">[</font>";
        if (PageNo > 10)
        {
            strPage += "<a href=\"" + Request.ServerVariables["SCRIPT_NAME"] + "?Page=" + Convert.ToString(((PageNo - 1) / (int)10) * 10) + "\">◀</a>";
        }
        else
        {
            strPage += "<font color=\"#c0c0c0\">◁</font>";
        }
        strPage += "<font color=\"#c0c0c0\">|</font>";
        for (i = (((PageNo - 1) / (int)10) * 10 + 1); i <= ((((PageNo - 1) / (int)10) + 1) * 10); i++)
        {
            if (i > NumPage)
            {
                break;
            }
            if (i == PageNo)
            {
                strPage += "<b>" + i.ToString() + "</b> <font color=\"#c0c0c0\">|</font>";
            }
            else
            {
                strPage += "<a href=\"" + Request.ServerVariables["SCRIPT_NAME"] + "?Page=" + i.ToString() + "\">" + i.ToString() + "</a> <font color=\"#c0c0c0\">|</font>";
            }
        }
        if (i < NumPage)
        {
            strPage += "<a href=\"" + Request.ServerVariables["SCRIPT_NAME"] + "?Page=" + Convert.ToString(((PageNo - 1) / (int)10) * 10 + 11) + "\">▶</a>";
        }
        else
        {
            strPage += "<font color=\"#c0c0c0\">▷</font>";
        }
        strPage += "<font color=\"#c0c0c0\">]</font></font><!--이전 10개, 다음 10개 페이징 처리 종료-->";
        ctlAdvancedPaingList.Text = strPage;
        #region 코드 설명
        //++PageNo; // 페이지 번호 1증가 : 0번째 페이지 -> 1페이지로 표시
        //string strPage = "";
        ////[1] 이전 10개 페이지
        //strPage += "<a href='" 
        //    + Request.ServerVariables["SCRIPT_NAME"] 
        //    + "?Page=" 
        //    + Convert.ToString(((PageNo - 1) / (int)10) * 10) 
        //    + "'>이전10개</a>";
        ////[2] 다음 10개 페이지
        //strPage += "<a href='"
        //    + Request.ServerVariables["SCRIPT_NAME"]
        //    + "?Page="
        //    + Convert.ToString(((PageNo - 1) / (int)10) * 10 + 11)
        //    + "'>다음10개</a>";
        //#region 처음/마지막
        //////[A] [처음] 이동 링크
        ////if (PageNo != 1) {
        ////    strPage +=
        ////    "<a href=\"" + Request.ServerVariables["SCRIPT_NAME"]
        ////    + "?Page=1\">[처음]</a> "; 
        ////}
        ////else {
        ////    strPage += "<span style='color:silver;'>[처음]</a>";
        ////}
        //////[B] [마지막] 이동 링크
        ////if (PageNo != NumPage) {
        ////    strPage +=
        ////    "<a href=\"" + Request.ServerVariables["SCRIPT_NAME"]
        ////    + "?Page=" + NumPage + "\">[마지막]</a> "; 
        ////}
        ////else {
        ////    strPage += "<span style='color:silver;'>[마지막]</a>";
        ////} 
        //#endregion
        ////[!] 최종 출력
        //ctlAdvancedPaingList.Text = strPage; 
        #endregion
    }