<div class="codetitle"> <span><a style="CURSOR: pointer" data="21294" class="copybut" id="copybut21294" onclick="doCopy('code21294')"><u>코드 복사</u></a></span> 코드는 다음과 같습니다.</div> <div class="codebody" id="code21294"> <br><%@ Page Language="C#" %> ; <BR><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br> <script runat="server"> <br></script> <br><html xmlns="http://www.w3.org/1999/xhtml" > ;head runat ="server"> <br><title>제목 없는 페이지</title><br><script 언어="javascript" type="text/javascript" > num ,c_p) <br>{ <br>var prev=0;var next=0;var temp=0;var html="" <br>if(parseInt(c_p 3)>num) <br>{ <br>prev=num; <br>} <br>else <br>{ <br>prev=parseInt(c_p 3) <br>} <br>temp=10-(prev-c_p); if (c_p-temp>0) <br>{ <br>next=c_p-temp; <br>} <br>else <br>{ <br>next=1 <br>//If 표시 if(c_p 3<10&&num>c_p 3) <br>{ <br>for(j=1;j<=10-( c_p 3); j ) <BR>{ <BR>이전 <BR>} <BR>} <BR>if(c_p!=num) <BR>{ <BR>html ="<a href='" url "index= " (1 c_p) "'>이전 페이지</a>" " " <br>} <br>for (i=prev;i>=next;i--) <br>{ <br> if (i==c_p) <br>{ <br>html ="<font color=red>" i " </font>" <br>} <br>else <br>{ <br>html ="<a href='" url "index=" i "'>" i "</a>" <br>} <br>} <br>if(c_p!=1 ) <br>{ <br>html ="<a href='" url "index=" (c_p-1) "'>다음 페이지</a>" " " <br>문서 .getElementById("pagenumber").innerHTML=html " 이동<input id="page" style="width: 33px" />페이지<input type="button" value="go" onclick="funcGo () " />"; <br>function funcLoad() <br>{ <br>var num=100; <br>var url="testpager.html?"; >index = getUrlParam("index"); <br>if(index==0) <br>{ <br>index=num; <br>} <br>showpage(url,num,index); } <br>function getUrlParam(name) <br>{ <br>var reg = new RegExp("(^|&)" name "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); <br>if (r!=null) <br>{ <br>return parsInt(unescape(r[2])); >} <br>return 0; <br>} <br>function funcGo() <br>{ <br>var num=100; <br>if(parseInt(document.getElementById("page").value )> ;0&&parseInt(document.getElementById("page").value)<=num) <br>{ <br>window.location.href="testpager.html?index="parseInt(document.getElementById("page ") .value); <br>} <br>else <br>{ <br>alert("페이지 번호가 존재하지 않습니다! "); <br> false 반환; <br>} <br>} <br></script> <br></head> <br><body onload="funcLoad(0)"> <br><form id="form1" runat="server"> <br><div id="pagenumber"> <br></div> ;/본문> <br></html> <br><br> </div>