Gridview paging code need

Posted by Jyothika07 under Regular Expressions on 9/29/2010 | Points: 10 | Views : 3907 | Status : [Member] | Replies : 1
Hi
I wrote code for gridview paging , when ever i compile program it runs successfully.But when i click on the second page the gridview is not displaying on the webpage.
please find the attached code.
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataSource = (DataSet)ViewState["studetails"];
GridView1.DataBind();

}

Any one can help me on these issue .

Thanks,
-jyothika




Responses

Posted by: Peermohamedmydeen on: 9/29/2010 [Member] Bronze | Points: 25

Up
0
Down
Hi,

Your code works fine for me.

kindly check "(DataSet)ViewState["studetails"]" returns Data.

If it is null it wont display.

Kindly check the spelling of "studetails" in all the viewstate calls.












Jyothika07, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response