How do I register post back control on page load using scriptmanager.registerpostbackcontrol(linkbutton) for each row on the gridview which has paging set to true? The linkbutton is within gridview under templatefield. The code I have is:
foreach (GridViewRow row in GridView1.Rows)
{
LinkButton LinkButton = row.FindControl("LinkButton ") as LinkButton ;
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
scriptManager.RegisterPostBackControl(LinkButton );
}
My problem is the linkbutton that shows up on the page at one point is working(it exports to pdf) without issues, but when I go to next page(gridview has paging set to true) . Now when I click on the linkbutton it doesn't work. I get this error.
"0x800a139e - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."
please help. Thank you,