I need to add some hyperlinks to a page dynamically that trigger an synchonous postback using
javascript:__doPostBack
and the radajax manager. I reduced the page to its most simplest form but i can't get it to work - the page performs a full postback when the link is clicked
I have created a panel that contains a placeholder. I am adding a hyperlink dynamically to the placeholder. The href property of the hyperlink is a javascript doPostback call. I have set up the RadAjax manager so that the pnl is the ajaxified control and the updated control is the pnl but this did not work - a full postback was performed (my thinking here was that is i set the pnl as the ajaxified control then any control within the panel such as my dynamically link that triggers a postback will lead to an asynchronous update of the panel itself). I also tried adding the dynamically created hyperlinks to the ajax manager in the code behind but that didn't work either. Please can you advise what I need to do.
many thanks
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="pnlTest">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pnlTest" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<br />
<br />
<asp:panel ID="pnlTest" runat="server">
<asp:PlaceHolder runat="server" ID="ph1"></asp:PlaceHolder>
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</asp:panel>
in page load event
Dim h As New HyperLink
h.NavigateUrl =
"javascript:__doPostBack('x','y')"
ph1.Controls.Add(h)
RadAjaxManager1.AjaxSettings.AddAjaxSetting(h, pnlTest)
label1.text = now()