thomasmutton
asked on
GridView Paging Postback Issue
Hello there,
I have a Gridview which is set to page. The problem is that I also have a button which executes a function. This function will only work if the databinding is in a if statement for !postback.
Whenever I try to page this GridView it gives me a blank page. I know why this is but is there a work around for it?
Thanks
I have a Gridview which is set to page. The problem is that I also have a button which executes a function. This function will only work if the databinding is in a if statement for !postback.
Whenever I try to page this GridView it gives me a blank page. I know why this is but is there a work around for it?
Thanks
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GridView1.DataSource = ImageList.GetImages();
GridView1.DataBind();
}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataBind();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.