Non-frame Ajax Paging (original) 1th/2 page _ajax related

Source: Internet
Author: User
Tags eval
Using the above method can really achieve Ajax paging effect, but I always feel not concise enough to study the afternoon, finally a little something O_o
first create the foreground page myajaxpager.aspx
Copy Code code as follows:

<%@ Page language= "C #" autoeventwireup= true "codebehind=" MyAjaxPager.aspx.cs "inherits=" AjaxDemo.AjaxPager.MyAjaxPager.MyAjaxPager "%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<style type= "Text/css" >
. a{}{height:20px; line-height:20px border-bottom:1px solid #d8dfea; clear:both;
. b{}{float:left; width:30px;}
. c{}{float:left; width:500px;}
</style>
<script type= "Text/javascript" src= "Http://www.cnblogs.com/JS/AjaxFunction.js" ></script>
<script type= "Text/javascript" >
var xmlHttp;
function GetData (pindex) {
XmlHttp = Getxmlrequest ();
Xmlhttp.onreadystatechange = Showrepeaterdata;
Xmlhttp.open ("Get", "ajaxprocess.aspx?index=" + Pindex, True);
Xmlhttp.send (NULL);
}
function Showrepeaterdata () {
if (xmlhttp.readystate = = 4 && xmlhttp.status = 200) {
var griddata = Xmlhttp.responsetext;
var Grid = document.getElementById ("grid");
grid.innerhtml = Griddata;
}
}
</script>
<body>
<form id= "Form1" runat= "Server" >
<div>
<div id= "Page" >
<p align= "Left" >
<a href= "Javascript:getdata (1);" >1</a>
<a href= "Javascript:getdata (2);" >2</a>
<a href= "Javascript:getdata (3);" >3</a>
<a href= "Javascript:getdata (4);" >4</a>
<a href= "Javascript:getdata (5);" >5</a>
<a href= "Javascript:getdata (50);" >50</a>
<a href= "Javascript:getdata (500);" >500</a>
<a href= "Javascript:getdata (5000);" >5000</a>
<a href= "Javascript:getdata (50000);" >50000</a>
<a href= "Javascript:getdata (99999);" >99999</a>
</p>
<div id= "Grid" >
<asp:repeater id= "Rptgrid" runat= "Server" >
<HeaderTemplate>
<table>
<tr>
<th style= "Border:solid 1px red;" > Number </th>
<th style= "Border:solid 1px red;" > Name </th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
&LT;TD style= "Border:solid 1px red;" ><%# Eval ("Id")%></td>
&LT;TD style= "Border:solid 1px red;" ><%# Eval ("Name")%></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
</div>
</div>
</form>
</body>

The screen is very simple, is a row of index address, when clicked on the link will be Ajax way to bind the data to the bottom of the repeater.



The main feature is implemented on the Ajaxprocess.aspx page that handles Ajax requests , let's take a look.

Current 1/2 page 12 Next read the full text
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.