Loading
if ur question is regarding gridview paging then set the allowing paging property as true. u will get next and prev button automatically and wirte the functionality in "pageindexchanging event" or if u want to continue the paging functionality using outside buttons then here is the example given below.
public
partial class _Default : System.Web.UI.Page{
static SqlConnection cn = new SqlConnection("server=DEVAPP;user id=sa;password=sa123;database=test"); protected void Page_Load(object sender, EventArgs e){
getdata();
}
public void getdata(){
SqlDataAdapter da = new SqlDataAdapter("select * from employee", cn); DataSet ds = new DataSet();da.Fill(ds,
"emp");GridView1.DataSource = ds;
GridView1.DataBind();
}
protected void prev_Click(object sender, EventArgs e){
if (GridView1.PageIndex > 0){
GridView1.PageIndex = GridView1.PageIndex - 1;
getdata();
}
}
protected void next_Click(object sender, EventArgs e){
GridView1.PageIndex = GridView1.PageIndex + 1;
getdata();
}
}