RadAjaxPanel cauing full postback 1st time

46 posts, 0 answers
  1. Jaap Goddijn
    Jaap Goddijn avatar
    3 posts
    Member since:
    Aug 2009

    Posted 27 Nov 2009 Link to this post

    Hi Colinbo,

    Looking in your code, i still don't how you solved the problem of the first-time-postback. Can you help me out here?

    Regards,
    Jaap
  2. ColinBowern
    ColinBowern avatar
    51 posts
    Member since:
    Aug 2012

    Posted 27 Nov 2009 Link to this post

    If you replace the <asp:Panel /> with an UpdatePanel the first postback works properly.  However if you use a RadAjaxPanel it does not.  The key part of the solution was to use <asp:Panel /> inside the repeater and AJAXify it during PreRender.  Rosen from Telerik support identiifed that the repeater item binding happens in a order that requires it to be like this: Here is what Rosen had to say in my support ticket:

    • I suspect that the behavior you are experiencing is due to how the repeater items are added to the Page's controls collection. As you may know RadAjax does insert UpdatePanels on a fly however in order this to work controls should be present in the page's controls collection. It seems that at the stage when repeater items are created RadAjaxPanel is not added to the page yet

  3. Eric Skaggs
    Eric Skaggs avatar
    1 posts
    Member since:
    May 2010

    Posted 07 May 2010 Link to this post

    I had this issue as well.  I was able to resolve it using ColinBowern's method as follows:

    User Control source:
    <telerik:RadAjaxLoadingPanel ID="ralpLoadingPanel" runat="server" Skin="Default" /> 
    <telerik:RadGrid ID="rdUserAccounts" runat="server" AllowPaging="True"    
        AllowSorting="True" EnableViewState="True" GridLines="None" PageSize="10"   
        Skin="Office2007" Width="100%" OnNeedDataSource="rdUserAccounts_NeedDataSource" 
        OnPreRender="rdUserAccounts_PreRender" > 
    </telerik:RadGrid> 
    <telerik:RadAjaxManagerProxy ID="rampAjaxManagerProxy" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="rdUserAccounts">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl LoadingPanelID="ralpLoadingPanel" ControlID="rdUserAccounts" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
    I added the OnPreRender attribute directly to my RadGrid control.

    Code-behind source:
    protected void rdUserAccounts_PreRender(object sender, EventArgs e)  
    {  
         RadAjaxManager ram = RadAjaxManager.GetCurrent(this.Page);  
         ram.AjaxSettings.AddAjaxSetting((Control)sender, (Control)sender);  
    This is the PreRender event for the RadGrid.

    Nothing else in my code changed.  When I first started, my page would always do a full postback on the first AJAX call.  After making these changes, the first AJAX call no longer forces a full postback.

    Hope that helps.

    Eric Skaggs
  4. Alejandro
    Alejandro avatar
    5 posts
    Member since:
    Jul 2010

    Posted 01 Jul 2010 Link to this post

    I have a RadAjaxPanel in a content page with several controls inside.
    I also place two lines of code in the Load event of the page, one when postback is False and another when it is true. That line of code calls a js file that keeps track of the user time while is logged in.
    Problem:
    when the user uses the control inside the Radajax panel no page postback is being fired, where can I place my server code to capture usage of the controls inside the RadAjax panel in order to call the JS file and keep the user logged in?
  5. Isaac
    Isaac avatar
    2 posts
    Member since:
    Mar 2011

    Posted 09 Mar 2011 Link to this post

    I have the same issue..
    It have nothing to do with DataBind();
    I work with RadTreeView on a search popup, I remove for the test the treeview, and its DataBind() since in the page load it didn't help whatsoever.

    I am still looking for help in this regard..
    I have posted a thread few days ago, but no responses yet...

    Best Regards,
    Isaac
  6. Aakansha
    Aakansha avatar
    22 posts
    Member since:
    Dec 2010

    Posted 17 Nov 2011 Link to this post

    Hello Telerik team,

    I appriciate your feedback related to the RadAjaxPanel doing postback first time.I have also faced the same issue related to this even ,may be found the solution within this thread itself but i am facing a issue which is restricting me to have a radajxpael or proxy inside usercontrol.Below is the issue:-

    On my page, i have usercontrol(PurchaseFor.ascx) inside which i have again one usercontrol(SelectUser.ascx) .i have PurchaseFor.ascx inside page Purchases.aspx .Inside usercontrol (PurchaseFor.ascx) i have two asp radiobuttons (i.e first is for "Purchase for me" and second is for "Purchase for someonelse") both have autopostback property true. on click of "purchase for someonelse" radio button my another usercontrol gets visible i.e (SelectUser.ascx) and on click of first radiobutton it gets hidden.I want that on this radiobutton click it should do a asyc postback rather than full postback so i have taken RadAjaxManager proxy on my usercontrol (SelectUser.ascx) as follows:-

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy3" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnl1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnl1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <asp:Panel ID="pnl1" runat="server" OnPreRender="pnl1_PreRender">
        <table>
            <tr>
                <td>
                    <asp:RadioButton ID="rbMe" runat="server" Text="This purchase is for <strong>me</strong>."
                        AutoPostBack="true" GroupName="rb1" OnCheckedChanged="rb_Checked" />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <asp:RadioButton ID="rbSomeoneElse" runat="server" Text="This purchase is for <strong>someone else</strong>."
                        CausesValidation="false" AutoPostBack="true" GroupName="rb1" OnCheckedChanged="rb_Checked" />
                    &nbsp;
                    <asp:LinkButton ID="cmdChange" runat="server" Text="Change" OnClick="cmdChange_Click"
                        CssClass="colorTextLink" Visible="false" />
                </td>
                <td align="left">
                    <div style="height: 20px; position: relative" id="divtest" runat="server">
                        <uc2:SelectUser ID="selUser" runat="server" EnabledAddNew="false" Type="Users"
                            Width="290px" Required="true" OnPreRender="selUser_OnPreRender" />
                    </div>
                </td>
            </tr>
        </table>
        <asp:LinkButton ID="lnk" runat="server" OnClick="lnk_Click"></asp:LinkButton>
        <asp:HiddenField ID="hdn" runat="server" />
    </asp:Panel>

    When i am putting the panel "pnl1" inside RadAjaxPanel its working fine i mean its updation the usercontrol "SelectUser" on click of radio button but its causing a postback first time issue later i trie with using RadAjaxManagerProxy when i had used proxy its throwing an exception please refer to the attach screen shot as (Error1.gif) .It gives an javascript error that .

    "EditModeStyleCtl001_ContentPlaceHolder1_ctl01_selUser_mxl.." is undefined"

    In my SelectUser.ascx i have one RadTextBox and div as well as we have uead a RadXmlHttpPanel which uses a webservice to bind RadGrid inside div.and when we start typing on textbox it populated grid with the results matching with the text enterd .I aslo tried to update RadXmlHttpPanel in proxy but stll no success.Please help us on this issue.

    Thanks telerik team.



       

  7. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 21 Nov 2011 Link to this post

    Hi Cindrella,

    Can you specify how the PurchaseFor.ascx user control is added to the page, is it declaratively defined or dynamically loaded?

    Additionally, I suggest that you do not put IScriptControls, as the RadGrid in RadXmlHttpPanel. You would better wrap the grid in RadAjaxPanel or ajaxify it with the RadAjaxManager available on the page.

    Also, under which version of the .NET Framework is the project built?

    Best wishes,
    Iana Tsolova
    the Telerik team
    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 their blog feed now
  8. Aakansha
    Aakansha avatar
    22 posts
    Member since:
    Dec 2010

    Posted 25 Nov 2011 Link to this post

    Hello lana,

    Thanks for the response.The PurchaseFor.ascx is dynamically loading.As inferenced by you i have not used grid i tried with div and not done any binding with grid simply used for loop and displayed recods in div itself but still i am facing the same issue.
    As well as project built under version 4.0.30319 RTMRel of .Net Framework. And one more thing i cannot include div inside RadAjaxPanel as well dont want to  ajaxify it with the RadAjaxManager available on the page. This user control has been used by other pages as well where i need a full postback .

    Please recommend us how to proceed with this.

    Thanks


  9. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 28 Nov 2011 Link to this post

    Hello Cindrella,

    What if you try o add the ajax settings for pnl1 dynamically, instead of using RadAjaxManagerProxy. For this purpose, you can comment out the proxy and in the SelectUser.ascx Page_Load server-side event handler add the below code:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.AjaxSettings.AddAjaxSetting(pnl1, pnl1);
    }

    If the issue persists, I would suggest that you open a formal support ticket and sends us a sample illustrating your exact scenario, or mimic it, and the issue.

    Greetings,
    Iana Tsolova
    the Telerik team
    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 their blog feed now
  10. Matthew
    Matthew avatar
    1 posts
    Member since:
    Jul 2011

    Posted 06 Feb 2012 Link to this post

    Hello,

    I noticed this thread is almost 3 years old.  Has a solution been found or an explanation offered?  I just discovered the same issue but am using user controls/ajax proxies with RadComboBoxes/RadToolTips.  Putting together a sample seems too tedious given the number of previous posts to this issue.  I find myself falling into what TonyG's post above describes.

    Can someone offer a general explanation to this issue?  The fixes above seem only to apply to FormViews, DataGrids, etc.

    Thanks,
    Matt
  11. Chanan Zass
    Chanan Zass avatar
    50 posts
    Member since:
    Aug 2012

    Posted 23 Jan 2014 Link to this post

    After trying everything for almost two days, we've decided to just hack a solution.
    Our scenario:
    - a page based on a master page
    - a user control called by the page dynamically.

    The user controls contains RadGrids, RadEditor, etc.

    If you take the code (of the master page, page and user control) and put it in a single page (as test) all works fine.
    That means the problem is due to the order of Ajaxifying in a page + user control.

    In short, what we ended up doing is:
    In the user control's code behind we added the following in the Page_Load:

    If Page.IsPostBack = False Then
                If Session("1st") IsNot Nothing Then
                    Session.Remove("1st")
                Else
                    Session.Add("1st", "first")
                    Response.Redirect(Request.Url.OriginalString)
                End If
    End If

    This reloads the page on first load.
    It's not very elegant, but it sure saves time.
  12. Mihail
    Mihail avatar
    4 posts
    Member since:
    Jul 2015

    Posted 13 Sep 2016 Link to this post

    Hi
    After a coupe of hours searching for a solution - found this thread.
    So the fastest solution is to replace:

    this:

    <telerik:RadAjaxPanel />

     

    with:

    <asp:UpdatePanel runat="server" >
       <ContentTemplate>
        <%-- your controls here --%>
       </ContentTemplate>  
    </asp:UpdatePanel>

    I am developing widgets in Sitefinity where there are an option to use Telerik.Web.UI controls.
    The version of the library currently used is: Telerik.Web.UI 2015.3.930.40

    Can someone confirm this bug is fixed in new version 2016.1 ?
  13. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 16 Sep 2016 Link to this post

    Hi Mihail,

    Note that the posts in this thread are rather old and I can not be completely sure based on the provided information if the issue you are currently facing is a bug and of it workaround for other than using asp update panel exists. Can I kindly ask you to open a separate thread and provided detailed explanation for the issue you are currently facing? Thus we will be able to revise it locally and advise you further.

    Regards,
    Maria Ilieva
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  14. Mihail
    Mihail avatar
    4 posts
    Member since:
    Jul 2015

    Posted 16 Sep 2016 in reply to Maria Ilieva Link to this post

    Hi,
    Thanks for reply, I will check for this bug in the new versions and if it appears, I will open an issue.
  15. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 17 Sep 2016 Link to this post

    Hi Mihail,

    Test your applictaion with the latest version of the controls and let us know how it goes.

    Regards,
    Maria Ilieva
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  16. Mihail
    Mihail avatar
    4 posts
    Member since:
    Jul 2015

    Posted 02 Oct 2016 Link to this post

    Hi,

    I can confirm the bug in the current thread doesn't appears in the new versions;

     

Back to Top