ASP.NET GridView and UpdatePanel

Posted by Echilon on Stack Overflow See other posts from Stack Overflow or by Echilon
Published on 2010-03-25T12:04:05Z Indexed on 2010/03/26 8:13 UTC
Read the original article Hit count: 373

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about gridview

Related posts about ASP.NET