How to exclude the AJAX post back for link button in GridView

4 posts, 0 answers
  1. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 04 Sep 2012 Link to this post

    I have a search button and a RadGrid which will have a template to include a link button. The link button is used to download file. While click the search button, it will bind the GridView.I put a telerik:RadAjaxLoadingPanel to include the RadGrid and add following code:
     <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
                        <telerik:AjaxSetting AjaxControlID="RadButtonSearch">
                                <telerik:AjaxUpdatedControl ControlID="RadGridHistory" LoadingPanelID="RadAjaxLoadingPanelHistory" />

    The problem is that the download link doesn't work while clicking. I think it's related with AJAX behavior and Response object. Whether there is a way to disable the AJAX post back for the link button in template column of RadGrid?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Sep 2012 Link to this post


    You can add a custom OnClick attribute to the linkbutton to register postback manually.
    foreach (GridDataItem item in RadGrid1.Items)
        LinkButton link = (LinkButton)item.FindControl("LinkButton1");
        link.Attributes.Add("onclick", string.Format("realPostBack(\"{0}\", \"\"); return false;", link.UniqueID));
    function realPostBack(eventTarget, eventArgument) {
           $find("<%= RadAjaxPanel1.ClientID %>").__doPostBack(eventTarget, eventArgument);

  3. DevCraft R3 2016 release webinar banner
  4. Rupesh
    Rupesh avatar
    1 posts
    Member since:
    Apr 2013

    Posted 18 Oct 2014 Link to this post

    I am getting  $find('RadAjaxPanel')=null in firebug watch window, so __doPostBack is not working and link button click performs AJAX post.

  5. Viktor Tachev
    Viktor Tachev avatar
    1444 posts

    Posted 22 Oct 2014 Link to this post

    Hello Rupesh,

    Note that when RadAjaxPanel is used any AJAX request initiated from a control wrapped in the panel updates the whole contents of the RadAjaxPanel.

    If you would like to force an AJAX-enabled control to perform postback you should use one of the approaches described in the following article:
    Viktor Tachev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top