I have seen this question before, but none of the answers seems to work for me. This is my updatePanel section (inside hi.ascx):
<asp:UpdatePanel runat="server" ID="upUL" UpdateMode="Conditional" >
<ContentTemplate>
...
<Angel:Pager id="pager" runat="server" OnPageClicked="Pager_PageSelected" />
<!--End of control div-->
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="lbBlock" />
<asp:AsyncPostBackTrigger ControlID="lbUnblock" />
<asp:AsyncPostBackTrigger ControlID="pager" EventName="PageClicked" />
</Triggers>
</asp:UpdatePanel>
Now this is the code within the Pager.ascx.vb:
Public Delegate Sub ClickPage(sender As Object, e As PageClickedEventArgs)
Public Event PageClicked As ClickPage
Public Class PageClickedEventArgs
Inherits EventArgs
Public Property PageNumber() As Integer
End Class
....
Protected Sub rpPaging_Click(ByVal sender As Object, ByVal e As CommandEventArgs)
Dim pageNum As Integer
Integer.TryParse(e.CommandArgument.ToString(), pageNum)
If (pageNum <> 0) Then
Dim args As New PageClickedEventArgs
args.PageNumber = pageNum
RaiseEvent PageClicked(sender, args)
End If
'SelectNewPage(pageNum)
End Sub
And finally, this is my code on the hi.ascx.vb page:
Public Sub Pager_PageSelected(sender As Object, ByVal e As Paging.PageClickedEventArgs)
BindData(False, e.PageNumber)
End Sub
As I stated in the title. When I raise an event from the pager.ascx, it causes a full post back(and works great but I wanted it to be in Ajax).
The other controls(LinkButtons) within this updatepanel like lbBlock and lbUnblock , are working great and not causing full postback!
Please please help me. I spent too much time on it and nothing seems to work!
thanks,
Ran