<%@ Page Language="C#" AutoEventWireup="true" Inherits="Control_Default" Codebehind="Default.aspx.cs" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
	无标题页
</title></head>
<body>
    <form name="myform"  runat="server" id="myform">
<div>
</div>

<table>
    <tr>
        <td colspan="2">
        
        <div id="Content"></div>
        <div id="load"  ></div>
              <div class="dpage" align="center" id="show_pageinfo" style="padding-bottom:2px;">
			共 <strong><span id="PageCount"></span></strong> 页/ <strong><span id="RecordCount"></span></strong> 条记录
			  当前第 <b><span id="CurrentPage"></span></b> 页 每页 <strong><span id="PageSize"></span></strong> 条记录
			  <a href="javascript:SetPage(parseInt(CurrentPage)-1);" id="up">上一页</a>
			  <a href="javascript:SetPage(parseInt(CurrentPage)+1);" id="down">下一页</a>
			  转到：<input type="text" name="ToPage" id="ToPage" size="5" onKeyPress="CheckNumberic();" maxlength="5">
			  <span style="border:1px solid #CCCCCC;padding:2px;cursor:hand;" onClick="SetPage(document.getElementById('ToPage').value);">GO</span>
		 </div>
        </td>
    </tr>
    <tr>
        <td colspan="2">

        </td>
    </tr>
</table>
<table>
    <tr>
        <td style="width: 202px">
            标题</td>
        <td style="width: 574px">
            <input id="txttitle" type="text" /></td>
    </tr>
    <tr>
        <td style="width: 202px; height: 40px">
            内容</td>
        <td style="width: 574px; height: 40px">
            <textarea id="txtContent" rows="8" cols="30"></textarea></td>
    </tr>
    <tr>
        <td style="width: 202px">
        </td>
        <td style="width: 574px">
            <input id="Button1" type="button" value=" O K  "  onclick=" CommentSave();"/>
            <input id="Reset1" type="reset" value="Reset" /></td>
    </tr>
</table>

 <script type="text/javascript">
    var CurrentPage=1;
    var PageCount=0;
    var PageSize=20;
    var RecordCount=0;
    function CheckNumberic()
    {
	if(!(window.event.keyCode>=48&&window.event.keyCode<=57))
		window.event.returnValue=false;
      }
 
    function CommentSave()
    {
    document.getElementById("load").style.display="block";

     // Control_Default.getinfo("8",GetSubCategory_callback);
     }
     function GetSubCategory_callback(response)
     {
        alert(response.value);
     }
     function GetList(CurrentPage)
     {
        Control_Default.GetList(CurrentPage,GetSubCategory_callbackCommentList);
     }
     function GetSubCategory_callbackCommentList(response)
     {
       if(response!=null)
       {
         PageCount=response.value.Tables[1].Rows[0].PageCount;
         RecordCount=response.value.Tables[1].Rows[0].RecordCount;
         PageSize=response.value.Tables[1].Rows[0].PageSize;
         document.getElementById("PageCount").innerHTML=PageCount;
         document.getElementById("RecordCount").innerHTML=RecordCount;
         document.getElementById("PageSize").innerHTML=PageSize;
         document.getElementById("CurrentPage").innerHTML=CurrentPage;
        var dt = response.value.Tables[0];
         var Content=document.getElementById("Content");
         for (var i = 0;i < dt.Rows.length;i++)
         {  
            //标题
             var list=document.createElement("div");
                 list.setAttribute("class","dtitle");
                 list.innerHTML= dt.Rows[i].Title;
                Content.appendChild(list);
          //内容
              
         //其它信息
         }
       }
            var load=document.getElementById("load")
            load.innerHTML="";
     }
     function  SetPage(Page)
     {
           var load=document.getElementById("load")
    	   load.innerHTML="<span ><img src='../Images/ajax/progressbar_green.gif'></span>";
           CurrentPage = parseInt(Page) > PageCount ? PageCount : Page ; 
           CurrentPage = parseInt(CurrentPage) < 1 ? 1 : CurrentPage ;
            var Content=document.getElementById("Content");
           Content.innerHTML="";
           GetList(CurrentPage);
    }
    //初始化
     GetList(CurrentPage);
</script>
</form>
</body>
</html>

