blondebier
Programmer
Hi Guys,
I have a master page in my solution with a script manager that should catch the click event of a button on it.
i.e. ScriptManager.GetCurrent(Me.Page).RegisterAsyncPostBackControl(Me.TestButton)
I then have the code for my test button:
Protected Sub TestButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TestButton.Click
Try
If Not WebFormContent.FindControl("UpdatePanel") Is Nothing Then
Dim up As UpdatePanel
up = WebFormContent.FindControl("UpdatePanel")
up.Update()
End If
Catch ex As Exception
' Do nothing
End Try
End Sub
My ContentPage has an update panel on it that I want to update without posting back.
<asp:Content ID="Content3" ContentPlaceHolderID="WebFormContent" runat="server">
<asp:ScriptManagerProxy ID="ScriptManagerProxy" runat="server"></asp:ScriptManagerProxy>
<asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Test" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
I added a ScriptManagerProxy for good measure as they seem to be required...
This does not work though. Every time I click on my test button it does a full post back.
Any ideas?
Cheers,
Francis
I have a master page in my solution with a script manager that should catch the click event of a button on it.
i.e. ScriptManager.GetCurrent(Me.Page).RegisterAsyncPostBackControl(Me.TestButton)
I then have the code for my test button:
Protected Sub TestButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TestButton.Click
Try
If Not WebFormContent.FindControl("UpdatePanel") Is Nothing Then
Dim up As UpdatePanel
up = WebFormContent.FindControl("UpdatePanel")
up.Update()
End If
Catch ex As Exception
' Do nothing
End Try
End Sub
My ContentPage has an update panel on it that I want to update without posting back.
<asp:Content ID="Content3" ContentPlaceHolderID="WebFormContent" runat="server">
<asp:ScriptManagerProxy ID="ScriptManagerProxy" runat="server"></asp:ScriptManagerProxy>
<asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Test" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
I added a ScriptManagerProxy for good measure as they seem to be required...
This does not work though. Every time I click on my test button it does a full post back.
Any ideas?
Cheers,
Francis