RadAjaxManager1_AjaxRequest doesn't fire for asp:linkbutton

2 posts, 0 answers
  1. nav100
    nav100 avatar
    48 posts
    Member since:
    Dec 2010

    Posted 19 Nov 2013 Link to this post

    I am trying to ajaxify the link button click event. But it doesn't fire. Here is my code.Could you please let me know what could be wrong?

        <asp:LinkButton ID="lnkTest" runat="server" />
           <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
                    <telerik:AjaxSetting AjaxControlID="LinkButton ">
                            <telerik:AjaxUpdatedControl ControlID="pnlGraph"></telerik:AjaxUpdatedControl>


                function raisePostBack(activity) {
                    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");

    Code behind

        lnkFinesValue.Text = String.Format("${0:C}", row["total_count"].ToString());.Text = String.Format("${0:C}", row["total_count"].ToString());
        lnkFinesValue.Text = String.Format("${0:C}", row["total_count"].ToString());.Attributes.Add("onClick", String.Format("raisePostBack('{0}');", "TEST"));

        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
          string test = e.Argument;        
  2. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 22 Nov 2013 Link to this post

    Hi Nara,

    In your AJAX settings you are have "LinkButton" as AjaxControlID, but in order to ajaxify the button you need to set its ID.

    Furthermore, from the provided code snippet it is not clear what exactly you are trying to accomplish, especially the part with the "lnkFinesValue" in the code behind. The LinkButton ID in the markup is "lnkTest", so it is not clear what "lnkFinesValue" is.

    Additionally, please have in mind that when ajaxRequest is fired from the RadAjaxManager, the manager itself must be set as initiator in the AJAX settings.

    Here is a simple example of ajaxified LinkButton control:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="LinkButton1">
                    <telerik:AjaxUpdatedControl ControlID="Label1" />
    <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    And the code behind:
    protected void LinkButton1_Click(object sender, EventArgs e)
        Label1.Text = DateTime.Now.ToString();

    Detail information for firing AJAX request through RadAjaxManager/RadAjaxPanel could be found at the following help article:

    Hope that helps.

    Konstantin Dikov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top