ASP.NET GridView and UpdatePanel
- by Echilon
I have a GridView, inside a UserControl, inside an UpdatePanel on a page.
There's a button in the GridView which needs to fire a postback. What happens is:
User clicks button - RowCommand Fires - Custom event is raised on UserControl - Page detects this and changes the active view index for a multiview and also the page title and some other controls outside the UpdatePanel.
The problem is, the page posts back asyncchronously, the page title changes, but the actions requireing a full postback don't happen because a full postback doesn't occur.
To register the button as a postback trigger I'm using:
ImageButton btnResults = e.Row.FindControl("btnResults") as ImageButton;
ScriptManager scrCurrent = ScriptManager.GetCurrent(this.Page);
if (btnResults != null && scrCurrent != null) {
scrCurrent.RegisterPostBackControl(btnResults);
}
I know this is a bit of a complicated problem, but I'd really appreciate any help.