Hi,
This seems an odd problem. We have an ASP.NET AJAX UpdatePanel within a UserControl. The UpdatePanel contains a GridView control that binds to a given DataTable to do its work. In order to give the GridView a double-click selection mechanism; the leftmost column is actually created by a hidden ButtonField object. In the GridView’s RowDataBound event, the following code hooks up each row so that it will react to a double click:
e.Row.Attributes("OnDblClick") = Page.ClientScript.GetPostBackClientHyperlink(doubleClickButton, String.Empty)
The only remaining issue is that each double click must initiate a full postback, and not the asyncronous postback that the UpdatePanel would normally produce. The following code takes care of that:
Private Sub LookupGrid_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim doubleClickButton As LinkButton = CType(e.Row.Cells(1).Controls(0), LinkButton)
ScriptManager.GetCurrent(Page).RegisterPostBackControl(doubleClickButton)
End If
End Sub
Everything operates exactly as expected, right up until the point that another control is used to initiate an asyncronous postback. As soon as this happens, the use of the RegisterPostBackControl method makes absolutely no difference. All of the double click buttons start to initiate the asyncronous postbacks instead of full postbacks. Interestingly, the only other control within the UpdatePanel that is coded to cause full postbacks always does so without problem. This control is a standard button webserver control, and is outside the GridView control, placed directly inside the UpdatePanel.
Various attempted workarounds haven’t helped, and I’m now really beginning to suspect some sort of bug in the ScriptManager or UpdatePanel component. Does anybody have any insight into this issue?
FYI: We are using VS.NET 2005 sp1 and ASP.NET 2.0 AJAX 1.0 (latest release). My own browser is IE7.0
Any help would be much appreciated.
This seems an odd problem. We have an ASP.NET AJAX UpdatePanel within a UserControl. The UpdatePanel contains a GridView control that binds to a given DataTable to do its work. In order to give the GridView a double-click selection mechanism; the leftmost column is actually created by a hidden ButtonField object. In the GridView’s RowDataBound event, the following code hooks up each row so that it will react to a double click:
e.Row.Attributes("OnDblClick") = Page.ClientScript.GetPostBackClientHyperlink(doubleClickButton, String.Empty)
The only remaining issue is that each double click must initiate a full postback, and not the asyncronous postback that the UpdatePanel would normally produce. The following code takes care of that:
Private Sub LookupGrid_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim doubleClickButton As LinkButton = CType(e.Row.Cells(1).Controls(0), LinkButton)
ScriptManager.GetCurrent(Page).RegisterPostBackControl(doubleClickButton)
End If
End Sub
Everything operates exactly as expected, right up until the point that another control is used to initiate an asyncronous postback. As soon as this happens, the use of the RegisterPostBackControl method makes absolutely no difference. All of the double click buttons start to initiate the asyncronous postbacks instead of full postbacks. Interestingly, the only other control within the UpdatePanel that is coded to cause full postbacks always does so without problem. This control is a standard button webserver control, and is outside the GridView control, placed directly inside the UpdatePanel.
Various attempted workarounds haven’t helped, and I’m now really beginning to suspect some sort of bug in the ScriptManager or UpdatePanel component. Does anybody have any insight into this issue?
FYI: We are using VS.NET 2005 sp1 and ASP.NET 2.0 AJAX 1.0 (latest release). My own browser is IE7.0
Any help would be much appreciated.