This is a migrated thread and some comments may be shown as answers.

RadAjaxPanel cauing full postback 1st time

45 Answers 900 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
DonKitchen
Top achievements
Rank 1
DonKitchen asked on 02 May 2008, 02:54 PM
I'm noticing that the RadAjaxPanel control is causing a full postback when one of its child controls is fired (like a checkbox with autopostback=true).  This only happens the 1st time and all subsequent postbacks happen via AJAX.

Any idea on why this may be happening?

Also, when more than 1 RadAjaxPanels are on the same page, it seems that all the other update panels work fine on their 1st trigger, it's just the first request from any of them that seems to be a problem.

These are inside a formview in a user control, if that matters.

45 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 05 May 2008, 08:09 AM
Hi DonKitchen,

Although I'm not sure what might be causing the problem, we always recommend using a RadAjaxManager/Proxy in a WebUserControls scenario:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Ajax/Examples/Manager/UserControl/DefaultCS.aspx

Please, give it a go and let us know if that helps.

Sincerely yours,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
DonKitchen
Top achievements
Rank 1
answered on 05 May 2008, 07:54 PM
I took a look at the article link you provided and didn't see anything that was helpful.  Even when I added the Ajax Manager to the master page, added an Ajax Proxy to the User Control, and removed the Ajax Panel and let the Proxy handle the updates I STILL see a full page postback when the first event happens.

So, adding the manager did not help.
0
DonKitchen
Top achievements
Rank 1
answered on 05 May 2008, 08:13 PM
I've actually reproduced the problem by putting the AjaxPanel inside a formview.  It seems that the user control has nothing to do with it.  I have prepared a sample project that I can upload if you tell me how.
0
Konstantin Petkov
Telerik team
answered on 06 May 2008, 07:32 AM
Hi DonKitchen,

Please, try a Manager outside the FormView as well as add the AJAX settings dynamically in this case (remove the AJAX Panel).

Feel free to write a support ticket to send a sample project. The attachments are not allowed in the forums.

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
DonKitchen
Top achievements
Rank 1
answered on 06 May 2008, 12:32 PM
I tried your suggestion about putting the manager outside the formview (which I had already) and moving the ajax settings into the code behind.  With your suggestions I don't get any Ajax functionality at all.

I will submit a support ticket I suppose now.  I am just wondering if you were speaking from experience in your suggestion or if you were just taking a guess that your suggestion *may* work?
0
Konstantin Petkov
Telerik team
answered on 06 May 2008, 01:03 PM
Hi DonKitchen,

Ajaxifying data sub controls might be a bit tricky in general due to the different naming containers. You may find this article interesting for example:

Ajaxify particlar templated GridView buttons

We will look into your project as soon as we can.

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
andrei
Top achievements
Rank 1
answered on 07 Jul 2008, 12:06 PM
Hi,

I have the same problem with a RadAjaxPanel placed inside an ascx user control.
First time it does a full page postback, the it's working normally.

Are there any solutions to this issue?

Regards
Andrei Gosman
0
DonKitchen
Top achievements
Rank 1
answered on 07 Jul 2008, 12:09 PM
I am still having this problem.
0
andrei
Top achievements
Rank 1
answered on 07 Jul 2008, 12:16 PM
So, no workarounds yet?

Andrei Gosman
0
DonKitchen
Top achievements
Rank 1
answered on 07 Jul 2008, 12:19 PM
I did eventually submit a support ticket and got the following response with a sample project:

The problem is related to the fact that the FormView in this case is not bound or bound too late for ajaxification. You can resolve this very easily if you access the FormView Controls collection in Page_Load. Here is an example:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim Controls As ControlCollection = FormView1.Controls
    End Sub

You can find modified version of your project attached.

That didn't however work in my example because I was using a formview inside of a user control.  I can provide you with the sample project they gave me if you like.  You can email me directly at donkitchen at gmail dot com and I'll send you the sample file.
0
Carlos
Top achievements
Rank 1
answered on 03 Nov 2008, 08:03 PM
i'm having the same issue on the 1st post back ... is there any fix for this yet?

thanks
0
DonKitchen
Top achievements
Rank 1
answered on 03 Nov 2008, 08:05 PM
I have not received a solution for this problem yet.
0
Carlos
Top achievements
Rank 1
answered on 03 Nov 2008, 09:33 PM
Good news...
I was able to get it working is kind of nasty but works...

The trick is calling the databind event and then adding ajax settings to the controls inside the detailsView before is rendered.



a few things first:
  • My issue was that my user control was posting back the full page the first time it rendered.
  • I was trying this with a DetailsView control insted of a FormView... my work around should work for you too...
  • My trigger is a textbox (FirstNameTextBox) change that changes another textbox (AliasTextBox)
what I did was:

  • Left all my code as it is (didn't remove ANYTHING, only added)
  • Declared 2 text boxes on my code behind
    TextBox txt1 = null, txt2 = null;  
  • Added a PreRender event to my control
            protected void Page_PreRender(object sender, EventArgs e) 
            { 
                if (!IsPostBack) 
                { 
                    RadAjaxManager manager = RadAjaxManager.GetCurrent(Page); 
                    DetailsView1.DataBind(); 
                    if ((txt1 != null) && (txt2 != null)) 
                    { 
                        manager.AjaxSettings.AddAjaxSetting(txt1, txt2); 
                    } 
                } 
            } 
  • Added a databound event to my detailsView Control
    protected void DetailsView1_DataBound(object sender, EventArgs e) 
            { 
     
     
     
                Control x = ((DetailsView)sender).FindControl("FirstNameTextBox"); 
                if (x != null
                { 
                    txt1 = (TextBox)x; 
                } 
     
                x = ((DetailsView)sender).FindControl("AliasTextBox"); 
                if (x != null
                { 
                    txt2 = (TextBox)x; 
                } 
     
     
     
            } 

I know this can get real nasty if you have multiple controls + triggers... but at least it works for now.......
0
Bridge24
Top achievements
Rank 1
answered on 04 Mar 2009, 06:38 PM
I got the exact same trouble (full reload of the page on the first postback, then ajax works fine after).

AND I FOUND A SOLUTION  (that is applied to my case, but it may help telerik find the bug).

Case:
I have a repeater and a sqldatasource.  In the itemtemplate of my repeater, I have a usercontrol, which contains an radajaxmanager (I got the same bug with the radajaxpanel, but NOT with the asp;updatepanel).  The repeater is associated with the SQLdatasource using the DataSourceID property.  There is absolutely no codebehind for this page, just a repeater, a sqldatasource, and the datasourceID to connect them together.  There is not ajax on the page containing the repeater.  The ajaxmanager is inside the usercontrol for its own content.
<!-- NON WORKING CASE --> 
<asp:Repeater ID="rptad" runat="server" DataSourceID="dsreview" > 
   <ItemTemplate> 
      <uc1:usercontrol containing the radajaxmanagerproxy> 
   </ItemTemplate> 
</asp:Repeater> 
<asp:SqlDataSource ID="dsreview" runat="server"
... 
</asp:SqlDataSource> 
 

In this case, the first call is NOT ajax enabled, the whole page refresh, but after the first call it works fine.

I changed only this:   I removed the datasourceid, and I used this codebehind to load my repeater:
    Private Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
        If Not Page.IsPostBack Then 
            rptad.DataSource = dsreview 
            rptad.DataBind() 
        End If 
    End Sub 

Then it works.

Note that this code is changed on the ASPX page containing the ASCX, there absolutely nothing changed in the usercontrol containing the radajaxmanager.  

I think that this is caused by the order in which the ajaxmanager generates its code relatively to the time where the repeater is databound.  I don't know exactly when the repeater is databound when using the datasourceid property, it seems to be somewhere between the page_load and the page_prerender, but this causes the trouble. 

Suggestion to telerik: Let the radajaxmanagerproxy do its job later during the page load to be sure to activate the ajax correctly even if we use the datasourceid property and let the page auto-charge itself.

I got this idea when reading the solution from Carlos that inspired me.  But I can't apply its solution because my radajaxmanager is not in the same page than the one containing the control I databind.  I tried to configure the radajaxmanagerproxy programatically in the prerender of my usercontrol but it did not help.

Then I will remove every datasourceid from every pages of my solution and load my data bound lists on the page_load events.

0
Yuri Hinojosa
Top achievements
Rank 1
answered on 10 Mar 2009, 02:41 PM
Hi,

I have the same problem my scenario is with a FormView (with latest telerik asp.control 2008 pack)

<FormView mode="edit" DataSourceID="DsObject">
<EditTemplate>
      <telerik:RadAjaxPanel>
           <telerik:RadGrid>
                      ..................................
           </telerik:RadGrid>
           ......................................
           ......................................
     </telerik:RadAjaxPanel>
</EditTemplate>
<FormView>

The first time that any children of the ajaxPanel perform a postback this is make as a full postback and subsequent postbacks by ajax, I confirm that is a Telerik bug because if you replace the RadAjaxPanel with an asp:UpdatePanel all work fine, the postbacks are made with ajax since the first time.

Please Telerik we need a solution, because out-of-the-box controls as an asp:UpdatePanel work fine in this scenario and yours not.

Regards,
Yuri

0
LeBear
Top achievements
Rank 1
answered on 10 Mar 2009, 04:35 PM
This may not apply, but FYI...

I also had this problem a while back.  It turned out that I was changing the action on the form via Javascript.  This caused the postback for the first Ajax call, but not for subsequent ones since the action wasn't being further changed.
0
Yavor
Telerik team
answered on 11 Mar 2009, 07:40 AM
Hello Yuri,

One thing you can try is to ajaxify the whole control, by nesting it in an AjaxPanel, rather than the editForm. If this does not help, you can open a formal support ticket, and send us the problematic code, for additional testing and debugging.

Kind regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
TonyG
Top achievements
Rank 1
answered on 08 May 2009, 08:42 PM
I've lost a lot of hair this week and I think this thread may hold the answer, but I thought that about a dozen other threads too.

I have a master page with a single content page which loads usercontrols dynamically.
On a specific UC I have a radpanelbar, a radgrid, and other controls.  Each of these is in a standard asp:Panel to get a fieldset/group frame. I load the panelbar manually and it seems to work fine on events.  But the radgrid is databound to an objectdatasource.  When the SelectedItemChanged event is fired, the grid is empty and there is no selected item or value.  It's only after the event is fired and after the PreRender that the Select method is triggered on the data source.  So now my thinking based on this thread is that I need to manually bind the grid in Page_Load so that the event has some data.

But I've been chasing at "what-if" ideas like this all week.
What if I wrap the grid in an AjaxPanel?
What if the asp:Panel is causing something funky?
What if I do or don't Ajaxify the asp:panel?
What if I move the AddAjaxSettings out of PreRender and move them somewhere else?
What if that script to avoid the x-microsoftajax header issue is causing Telerik Response.Writes to fail?

I just wish we had a better set of rules and better diagnostic tools.  Working with a black box like this is an ongoing exercise in futility.

It's time to get away from the keyboard and re-think my approach to solving these problems...
0
TonyG
Top achievements
Rank 1
answered on 09 May 2009, 09:42 PM
Gosh I hope I'm not just blabbing but I have a follow-up to Dani's notes.  I think this will help some people.

 
I have a RadAjaxPanel.  I load this panel manually by populating the Items collection.
I also have a RadAjaxGrid which is databound to an ObjectDataSource.

When the ItemClick event occurs on the panel, the required data is available in the event handler.  The sequence of events that are fired are as follows:

Load
ItemClick
Select the ODS data for the grid
PreRender

When I click the grid, the SelectedIndexChanged is fired but the data is not available in the handler.  The sequence of events here is as follows:

Load
SelectedIndexChanged
PreRender
Select method for ODS

Why the difference?

Following Dani's comments I added a mygrid.DataBind() to a handler executed from Page_Load.  So the grid is bound and when the handler is invoked the data is there and everything with this now works fine.

Looking back at this I guess there are two things going on here: First there is the matter of when the handler fires, though that's not related to the data being available for the event.  Second there's the matter of making sure data is available for the event.  Why do I need to rebind?  Why isn't it available from ViewState?

I really hate to play guessing games.  Am I missing some fundamental rule of the ASP.NET page life cycle, or is there a bug somewhere?

Thanks to anyone who's reading, and I hope this helps anyone looking for a solution.

0
Jaap Goddijn
Top achievements
Rank 1
answered on 27 Aug 2009, 08:56 AM

Hello Telerik team,

 

has a solution for this problem been found? I tried all suggestions in this threat, but it doesn't help me. The first postback is still a full postback.

Thanks,
Jaap

0
DonKitchen
Top achievements
Rank 1
answered on 27 Aug 2009, 11:15 AM
None of the solutions here fixed my problem.
0
Sebastian
Telerik team
answered on 27 Aug 2009, 11:47 AM
Hi guys,

If you still experience issues as discussed in this thread, I suggest you isolate a working sample and send it enclosed to a regular support ticket. We will examine your test cases and will get back to you with our findings.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
TonyG
Top achievements
Rank 1
answered on 27 Aug 2009, 03:46 PM
That's usually a reasonable request but given that so many people have posted their experience, instructions for reproducing related issues, and even code, isn't there already enough here for you to go on? I have to say, I gave up on the idea of fixing this months ago and just made my code expect the weird behavior that I was seeing. Please forgive, but we need to move on with our development and coming back to old threads to provide a reproducible case for you is very low on our list of priorities and justified allocations of time. As software developers of course we often ask for reproducible cases just like you do. But in this case how much more do you really need? Please just play with it using the information already provided here and the problems should become evident pretty quickly. If you really can't reproduce any of the issues reported here, I'll do what I can with the latest release to create an isolated code sample for you - or to report that I no longer see the issues reported.
0
DonKitchen
Top achievements
Rank 1
answered on 27 Aug 2009, 03:57 PM
Agreed, as you can see from this thread i went through the trouble of already reproducing the problem.  The sample code i got back was using some different scenario that didn't fit what I was even doing.

I too have kind of given up on this and just learned to live with it for now.
0
Sebastian
Telerik team
answered on 28 Aug 2009, 08:13 AM
Hello guys,

Unfortunately I am not able to reproduce the abnormality following the directions from your posts. I requested a sample application because I suspect that there might be something specific in your configurations which causes the postback to happen. I will be expecting your working examples in order to provide as much to-the-point answer/solution as possible.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
ColinBowern
Top achievements
Rank 1
answered on 23 Nov 2009, 07:53 PM
I managed to repro this issue with Repeater nested inside a FormView.  Using an <asp:UpdatePanel /> worked fine.  I have sent sample code in a support ticket (#260396).
0
Jaap Goddijn
Top achievements
Rank 1
answered on 24 Nov 2009, 01:09 PM
Hopefully that helps the Telerik team. I'm still having this problem.
0
ColinBowern
Top achievements
Rank 1
answered on 24 Nov 2009, 03:28 PM
Here is a spike I used to get it working:

<telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
<telerik:RadAjaxManager ID="AjaxManager" runat="server" /> 
<asp:FormView ID="Document" runat="server" DataSourceID="DocumentDataSource" 
    DefaultMode="Edit" OnItemUpdating="Document_Updating">  
    <EditItemTemplate> 
        <h2> 
            Document Name:  
            <%# Eval("Name") %></h2>  
        <div> 
            <asp:Label runat="server" AssociatedControlID="DocumentDate" Text="Document Date:" /> 
            <telerik:RadDateInput ID="DocumentDate" runat="server" SelectedDate='<%# Bind("DocumentDate") %>' /> 
        </div> 
        <asp:Repeater ID="Sections" runat="server" DataSource='<%# Bind("Categories") %>' 
            OnDataBinding="Sections_DataBinding">  
            <ItemTemplate> 
                <asp:Panel ID="AjaxPanel" runat="server" OnPreRender="AjaxPanel_PreRender">  
                    <contenttemplate> 
                        <asp:HiddenField runat="server" ID="Name" Value='<%# Eval("Name") %>' /> 
                        <h3> 
                            Section Name:  
                            <%# Eval("Name") %> 
                        </h3> 
                        <asp:LinkButton ID="Edit" runat="server" OnClick="Edit_Click" Text="Edit" /> 
                        <asp:LinkButton ID="Done" runat="server" Text="Done" Visible="false" OnClick="Done_Click" /> 
                        <telerik:RadListView ID="Items" runat="server" AllowMultiItemEdit="true" DataKeyNames="Name" 
                            OnNeedDataSource="Items_NeedDataSource">  
                            <LayoutTemplate> 
                                <div> 
                                    <asp:PlaceHolder ID="itemPlaceholder" runat="server" /> 
                                </div> 
                            </LayoutTemplate> 
                            <EditItemTemplate> 
                                <div> 
                                    <asp:TextBox ID="Name" runat="server" Text='<%# Bind("Name") %>' /> 
                                </div> 
                            </EditItemTemplate> 
                            <ItemTemplate> 
                                <div> 
                                    <asp:Literal ID="Name" runat="server" Text='<%# Eval("Name") %>' /> 
                                </div> 
                            </ItemTemplate> 
                        </telerik:RadListView> 
                    </contenttemplate> 
                </asp:Panel> 
            </ItemTemplate> 
        </asp:Repeater> 
        <asp:Button ID="Save" runat="server" CommandName="Update" Text="Save" OnClick="Save_Click" /> 
        <asp:Button ID="Cancel" runat="server" CausesValidation="false" CommandName="Cancel" 
            Text="Cancel" /> 
    </EditItemTemplate> 
</asp:FormView> 
<asp:ObjectDataSource ID="DocumentDataSource" runat="server" DataObjectTypeName="Foo.Document" 
    TypeName="Foo.DataSource" SelectMethod="RetrieveDocument" UpdateMethod="UpdateDocument" /> 


In the code behind:

protected void Document_Updating(object sender, FormViewUpdateEventArgs e)  
{  
    e.NewValues["Categories"] = ViewState["Sections_Data"];  
}  
 
protected void Save_Click(object sender, EventArgs e)  
{  
    var save = (Control)sender;  
    var sections = (Repeater)save.Parent.FindControl("Sections");  
 
    foreach(RepeaterItem repeaterItem in sections.Items)  
    {  
        var done = (Control)repeaterItem.Controls[0].FindControl("Done");  
        if (done.Visible)  
        {  
            Done_Click(done, EventArgs.Empty);  
        }  
    }  
}  
 
protected void Sections_DataBinding(object sender, EventArgs e)  
{  
    var sections = (Repeater)sender;  
    ViewState["Sections_Data"] = sections.DataSource;  
}  
 
protected void AjaxPanel_PreRender(object sender, EventArgs e)  
{  
    RadAjaxManager.GetCurrent(this).AjaxSettings.AddAjaxSetting((Control)sender, (Control)sender);  
}  
 
protected void Items_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)  
{  
    var items = (DataBoundControl)sender;  
 
    var container = (IDataItemContainer)items.Parent.Parent;  
    if (container.DataItem != null)  
    {  
        items.DataSource = ((Category)container.DataItem).Items;  
    }  
    else 
    {  
        var name = (HiddenField)items.Parent.FindControl("Name");  
        var dataSource = (List<Category>)ViewState["Sections_Data"];  
        items.DataSource = dataSource.Find(category => category.Name == name.Value).Items;  
    }  
}  
 
protected void Edit_Click(object sender, EventArgs e)  
{  
    var edit = (Control)sender;  
 
    var items = (RadListView)edit.Parent.FindControl("Items");  
    foreach (RadListViewDataItem item in items.Items)  
    {  
        items.EditIndexes.Add(item.DisplayIndex);  
    }  
    items.Rebind();  
 
    var done = (Control)edit.Parent.FindControl("Done");  
    done.Visible = true;  
    edit.Visible = false;  
}  
 
protected void Done_Click(object sender, EventArgs e)  
{  
    var done = (Control)sender;  
 
    var items = (RadListView)done.Parent.FindControl("Items");  
    var name = (HiddenField)done.Parent.FindControl("Name");  
 
    var dataSource = (List<Category>)ViewState["Sections_Data"];  
    items.DataSource = dataSource.Find(category => category.Name == name.Value).Items;  
    for (int i = 0; i < items.EditItems.Count; i++)  
    {  
        ((RadListViewDataItem)items.EditItems[i]).UpdateValues(((IList<DocumentItem>)items.DataSource)[i]);  
    }  
 
    items.ClearEditItems();  
    items.Rebind();  
 
    var edit = (Control)done.Parent.FindControl("Edit");  
    edit.Visible = true;  
    done.Visible = false;  
0
Sebastian
Telerik team
answered on 26 Nov 2009, 01:02 PM
Hello colinbo,

We are glad that you found a solution and shared it with the rest of the Telerik community members. As a token of gratitude I updated your Telerik points.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jaap Goddijn
Top achievements
Rank 1
answered on 27 Nov 2009, 12:35 PM
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
0
ColinBowern
Top achievements
Rank 1
answered on 27 Nov 2009, 03:24 PM

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

0
Eric Skaggs
Top achievements
Rank 1
answered on 07 May 2010, 05:38 PM
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
0
Alejandro
Top achievements
Rank 1
answered on 01 Jul 2010, 07:32 PM
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?
0
Isaac
Top achievements
Rank 1
answered on 09 Mar 2011, 01:44 PM
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
0
Aakansha
Top achievements
Rank 1
answered on 17 Nov 2011, 09:28 AM
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.



   

0
Iana Tsolova
Telerik team
answered on 21 Nov 2011, 05:00 PM
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
0
Aakansha
Top achievements
Rank 1
answered on 25 Nov 2011, 03:58 PM
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


0
Iana Tsolova
Telerik team
answered on 28 Nov 2011, 11:13 AM
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
0
Matthew
Top achievements
Rank 1
answered on 06 Feb 2012, 06:16 PM
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
0
Chanan Zass
Top achievements
Rank 1
answered on 23 Jan 2014, 10:25 AM
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.
0
Mihail
Top achievements
Rank 1
answered on 13 Sep 2016, 03:51 PM

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 ?
0
Maria Ilieva
Telerik team
answered on 16 Sep 2016, 02:59 PM
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.
0
Mihail
Top achievements
Rank 1
answered on 16 Sep 2016, 03:14 PM
Hi,
Thanks for reply, I will check for this bug in the new versions and if it appears, I will open an issue.
0
Maria Ilieva
Telerik team
answered on 17 Sep 2016, 09:42 AM
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.
0
Mihail
Top achievements
Rank 1
answered on 02 Oct 2016, 08:28 PM

Hi,

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

 

Tags
Ajax
Asked by
DonKitchen
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
DonKitchen
Top achievements
Rank 1
andrei
Top achievements
Rank 1
Carlos
Top achievements
Rank 1
Bridge24
Top achievements
Rank 1
Yuri Hinojosa
Top achievements
Rank 1
LeBear
Top achievements
Rank 1
Yavor
Telerik team
TonyG
Top achievements
Rank 1
Jaap Goddijn
Top achievements
Rank 1
Sebastian
Telerik team
ColinBowern
Top achievements
Rank 1
Eric Skaggs
Top achievements
Rank 1
Alejandro
Top achievements
Rank 1
Isaac
Top achievements
Rank 1
Aakansha
Top achievements
Rank 1
Iana Tsolova
Telerik team
Matthew
Top achievements
Rank 1
Chanan Zass
Top achievements
Rank 1
Mihail
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or