I have created a really basic page with a panel that contains some content and a dynamically created link button. When the link button is clicked the panel is updated. The update is supposed to be done by a partial postback using the radajaxmanager but, for reasons I don't understand, every other time the link button is clicked a full postback is performed rather than a partial postback. In other words i get one partial postback then one full postback and so on.
I have reduced the page to its bare bones below. Please can you tell me how I fix this.
<%
@ Register Assembly="AspMapNET" Namespace="AspMap.Web" TagPrefix="cc1" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >
<
head runat="server">
<title>Untitled Page</title>
</
head>
<
body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</asp:Panel>
</form>
</
body>
</
html>
Partial
Class Default2
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim l As New LinkButton
l.Text =
"link button"
AddHandler l.Click, AddressOf LinkButton_Click
PlaceHolder1.Controls.Add(l)
RadAjaxManager1.AjaxSettings.AddAjaxSetting(l, Panel1)
End Sub
Protected Sub LinkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Label1.Text = Now()
End Sub
End
Class