Only Telerik controls cause Ajax Update and show LoadingPane

Posted by Community Admin on 03-Aug-2018 21:21

Only Telerik controls cause Ajax Update and show LoadingPanel

All Replies

Posted by Community Admin on 01-Aug-2011 00:00

This is a strange one indeed.  I have a page with multiple custom user controls defined as widgets and placed onto the page.   The usercontrols use RadAjaxPanels to display and update content within themselves.

I've noticed that the widget works as expected as long as the postback is initiated from a Telerik control, but it does a full page refresh if the postback comes from a standard ASP.NET Control.  Here is a quick example:

ASCX:

<sf:RadAjaxPanel runat="server" ID="rapTest" LoadingPanelID="ralpPoll">
        <asp:Button runat="server" ID="btnTestSleep" Text="Test ME!" OnClick="btnTest_Click" />
        <sf:RadButton runat="server" ID="btnTelerik" Text="Rad Button Test" OnClick="btnTest_Click"></sf:RadButton>
</sf:RadAjaxPanel>

C#:
protected void btnTest_Click(object sender, EventArgs e)
       
          System.Threading.Thread.Sleep(5000);
       

When clicking on the "btnTelerik" (RadButton), the loading panel shows and everything is as expected.  However, when I click on the "btnTestSleep" (Standard ASP.NET Button), the full page reloads and no Loading Panel is shown.

Similar results are shown with other standard .NET controls.

Is this a configuration error somewhere?   Thank you.

Posted by Community Admin on 02-Aug-2011 00:00

Hello Amir,

Could you check whether you have RadAjaxManager in your template? Have you tried used the ASP.NET UpdatePanel to handle the post back?

Greetings,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 08-Aug-2011 00:00

No RadAjaxManager in this template.   I did try to ajaxify the page with an radAjaxManager with the same results however.   Using an Asp UpdatePanel seems to work properly.  However, I lose my rad ajax loading panel.

Posted by Community Admin on 09-Aug-2011 00:00

Hi Amir,

We had some issues with the AJAX in older version - SP1 and SP2. I am testing with SP3 and the AJAX is triggered properly at my end.

Best wishes,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 15-Aug-2011 00:00

Hi,

Issues with AJAX in SP3 and 4.2 are still there... I cannot use ajaxified controls properly yet...

We need more attention on this, it's been a long time that's not working. 

John

Posted by Community Admin on 18-Aug-2011 00:00

Hi John,

I managed to replicate the issue with Sitefinity 4.2 and logged a bug that we will investigate further. Here is the PITS that you can follow

http://www.telerik.com/support/pits.aspx#/public/sitefinity/7467

Regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 24-Aug-2011 00:00

Can anybody help me with the following issue?  Or, confirm that it IS in fact an issue?... going kinda crazy here trying to figure this out.  The issue in this thread smells like it has something to do with what I am seeing, but what I am seeing is just too bizaar for me to completely understand or confirm what the problem is.

I have a set of User Controls built from an external assembly that I am including into a Sitefinity 4.2 project.  Both the User Control assembly and SF 4.2 are using the same version of Telerik controls (latest version).

My external assembly (web project) with my controls works PERFECTLY.  I HEAVILY use the Telerik control suite, so I have Telerik controls all over the place.  Everything works as expected.

I go through the procedure of getting that assembly into the SF 4.2 project (copying assembly DLL, moving ascx file over... adding control to toolbox.)  I have the control in the toolbox.  I CAN put the controls on pages just fine.  That is about where the fun ends...  Pretty much everything goes haywire from there.  The public pages load correctly with my control on the page, but almost any Telerik flavored control in my user control has issues.  For example, RadComboList... you can't click the dropdown to make it drop down.  RadEditor... you can't actually put your cursor into the content area.

Part of my issue (with some other weirdness) was due to the fact that I did not have the "enableViewState" marked in the page properties in SF.  I DO have this enabled now and corrected some of the data disappearing from the dropdowns and so forth.  But, I STILL have the issue with RadControls going out to lunch.

More weirdness...  I have one of these controls placed in a STAND ALONE test page without ANYthing else on the page.  I also have it placed within the normal website on a page where it will hopefully one day reside.  On the STANDALONE page...  It seems to work (most of the time) in Firefox (3.6.18), but it NEVER works in IE9.  By "work" all I am referring to is to be able to click the dropdown portion of the RadComboBox and have it dropdown.  Nothing happens in IE9 (or in compatibility mode)...well, nothing except it gets into a real tizzy and throws a JS error anytime anything else is done (including trying to reload the page or close the page):

Line: 419
Error: Unable to get value of the property 'length': object is null or undefined

This control I speak of here is just a VERY VERY simple test control for this issue.  RadTextBox and RadComboBox.  I have a MUCH more complex production user control that ALSO WORKS pretty well in the Firefox case, but also NOT in the IE9 case.  HOWEVER... this much more complex control does NOT work in the real SF page where I want it to go (in Firefox).  Very werid...  Of course it certainly doesn't work in IE9.

I have debugged the pages that I speak of here and EVERYTHING goes through EXACTLY how I would expect with no exceptions being thrown...  except for the JS problem above that occurs AFTER you try to interact with the broken RadControls.

I'll include the VERY VERY basic control code here.  Note, I do handle adding script managers and/or RadAjaxManagers on the fly (in code)...in the base pages if they don't already exist.  Again, this code works flawlessly in the user controls own assembly...AND in a lot of cases (like Firefox).  I just don't know what the disconnect is here, but I have a big project that I need to produce with the controls from this assembly and don't know where to turn...

Telerik control BAD uc:
%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ucTestTel1.ascx.vb" Inherits="SitefinityUI.ucTestTel1" %>
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnTest1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlLit" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlLit2" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnTest2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlLit" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlLit2" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"
        Skin="Default" InitialDelayTime="1000" MinDisplayTime="1000">
    </telerik:RadAjaxLoadingPanel>
 
    <div>
        <asp:Panel ID="pnlLit" runat="server" Height="50">
            <h2>RadTextBox1</h2>
            <telerik:RadTextBox ID="fldtxtBox1" runat="server" />
        </asp:Panel>
        <br />
        <asp:Panel ID="pnlLit2" runat="server" Height="50">
            <h2>RadComboBox1</h2>
            <telerik:RadComboBox ID="fldrcbDropdown1" runat="server" />
        </asp:Panel>
        <br />
        <br />
        <asp:Button ID="btnTest1" runat="server" Text="Test +1" />
        <br />
        <br />
        <asp:Button ID="btnTest2" runat="server" Text="Test +2" />
 
    </div>
Public Class ucTestTel1
    Inherits BasePages.BaseUserControlSiteFinity
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Me.LoadDefaults()
        End If
    End Sub
 
    Private Sub LoadDefaults()
        Dim lstItems As New List(Of String) From "Begin Here", "Item 0", "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9"
        Me.fldrcbDropdown1.DataSource = lstItems
        Me.fldrcbDropdown1.DataBind()
        Me.fldrcbDropdown1.SelectedIndex = 0
 
    End Sub
 
    Private Sub btnTest1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnTest1.Click
        Threading.Thread.Sleep(1500)
        Me.pnlLit.BackColor = Drawing.Color.Aqua
 
        If ((Me.fldrcbDropdown1.SelectedIndex + 1) <= (Me.fldrcbDropdown1.Items.Count - 1)) Then
            Me.fldrcbDropdown1.SelectedIndex += 1
        Else
            Me.fldrcbDropdown1.SelectedIndex = 0
        End If
 
        Me.fldtxtBox1.Text = Me.fldrcbDropdown1.SelectedValue
 
    End Sub
 
    Private Sub btnTest2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnTest2.Click
        Threading.Thread.Sleep(1500)
        Me.pnlLit.BackColor = Drawing.Color.Beige
 
        If ((Me.fldrcbDropdown1.SelectedIndex + 2) <= (Me.fldrcbDropdown1.Items.Count - 1)) Then
            Me.fldrcbDropdown1.SelectedIndex += 2
        Else
            Me.fldrcbDropdown1.SelectedIndex = 0
        End If
 
        Me.fldtxtBox1.Text = Me.fldrcbDropdown1.SelectedValue
 
    End Sub
 
    Public Overrides Sub BindScreen(oDataObject As Object)
    End Sub
 
    Public Overrides Sub UnbindScreen(Optional IsCancelCommand As Boolean = False)
    End Sub
End Class

If I replace the above with a REGULAR ASP.NET TextBox and DropDownList... everything works in IE9!!!  The RadAjaxManager seems to work regardless...  It seems like it is the actual UI controls that are the problem.

For reference, here is how I handle creating script managers and RadAjaxManager's in the base class...although...as I say, this works fine in the "asp.net control" scenario.
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
    'On the INIT of the UC (which happens BEFORE the PAGE_INIT), add a hook/handler to that event so we can create some stuff at the right time.
    AddHandler Me.Page.Init, AddressOf Me.ParentPage_Init
 
    MyBase.OnInit(e)
End Sub
 
Private Sub ParentPage_Init(ByVal sender As Object, ByVal e As System.EventArgs)
    'Ok... The PAGE INIT (for the PAGE...not UC) was fired and we are doing some work here)
    Me.CreateScriptManager()
End Sub
 
Private Sub CreateScriptManager()
    'Find out of we have a SCRIPT MANAGER yet... if not, add it.
    Dim sm As ScriptManager = ScriptManager.GetCurrent(Me.Page)
    If sm Is Nothing Then
        sm = New ScriptManager
        sm.EnablePartialRendering = True
        sm.Scripts.Add(New ScriptReference("Telerik.Web.UI.Common.Core.js", "Telerik.Web.UI"))
        sm.Scripts.Add(New ScriptReference("Telerik.Web.UI.Common.jQuery.js", "Telerik.Web.UI"))
        sm.Scripts.Add(New ScriptReference("Telerik.Web.UI.Common.jQueryInclude.js", "Telerik.Web.UI"))
        sm.Scripts.Add(New ScriptReference("~/js/Alerts.js"))
        sm.Scripts.Add(New ScriptReference("~/js/onRequestStart.js"))
        sm.Scripts.Add(New ScriptReference("~/js/myFunctions.js"))
 
        'Add the SCRIPT MANAGER to the Page's FORM controls coll.
        Me.Page.Form.Controls.Add(sm)
    Else
        'Script Manager exists... , but does it have our scripts loaded?
        Dim oScript1 = sm.Scripts.Where(Function(db) db.Name.ToLower = "Telerik.Web.UI.Common.Core.js".ToLower).FirstOrDefault
        If oScript1 Is Nothing Then
            sm.Scripts.Add(New ScriptReference("Telerik.Web.UI.Common.Core.js", "Telerik.Web.UI"))
        End If
        Dim oScript2 = sm.Scripts.Where(Function(db) db.Name.ToLower = "Telerik.Web.UI.Common.jQuery.js".ToLower).FirstOrDefault
        If oScript2 Is Nothing Then
            sm.Scripts.Add(New ScriptReference("Telerik.Web.UI.Common.jQuery.js", "Telerik.Web.UI"))
        End If
        Dim oScript3 = sm.Scripts.Where(Function(db) db.Name.ToLower = "Telerik.Web.UI.Common.jQueryInclude.js".ToLower).FirstOrDefault
        If oScript3 Is Nothing Then
            sm.Scripts.Add(New ScriptReference("Telerik.Web.UI.Common.jQueryInclude.js", "Telerik.Web.UI"))
        End If
 
        Dim oScript4 = sm.Scripts.Where(Function(db) db.Path.ToLower = "~/js/Alerts.js".ToLower).FirstOrDefault
        If oScript4 Is Nothing Then
            sm.Scripts.Add(New ScriptReference("~/js/Alerts.js"))
        End If
        Dim oScript5 = sm.Scripts.Where(Function(db) db.Path.ToLower = "~/js/onRequestStart.js".ToLower).FirstOrDefault
        If oScript5 Is Nothing Then
            sm.Scripts.Add(New ScriptReference("~/js/onRequestStart.js"))
        End If
        Dim oScript6 = sm.Scripts.Where(Function(db) db.Path.ToLower = "~/js/myFunctions.js".ToLower).FirstOrDefault
        If oScript6 Is Nothing Then
            sm.Scripts.Add(New ScriptReference("~/js/myFunctions.js"))
        End If
 
    End If
 
    'We can't test for RADAJAXMANAGER (with the .GetCurrent method anyway) at this point in the page lifecycle, so we need to do it manually.
    Dim ram As RadAjaxManager = DQSFunctions.Search.FindControlRecursiveByID(Me.Page.Form.Controls, "RadAjaxManager1")
    If ram Is Nothing Then
        'Go create a RADAJAXMANAGER (again, assuming it isn't there) and add it to the Page as well.
        Me.Page.Form.Controls.Add(Me.CreateRadAjaxManager)
    End If
 
End Sub
 
Private Function CreateRadAjaxManager() As RadAjaxManager
    Dim ram As RadAjaxManager = New RadAjaxManager
    ram.ID = "RadAjaxManager1"
    ram.EnableHistory = True
    ram.UpdatePanelsRenderMode = UpdatePanelRenderMode.Inline
 
    Return ram
 
End Function

Can anybody give me a clue as to what is going on here??
Is there still big issues with using Telerik controls inside user controls from outside assemblies?


Posted by Community Admin on 26-Aug-2011 00:00

Hello Shawn Krivjansky,

Thank for explaining the issue in detail.

I have tried looking for a solution, however I have not been able at the moment using embedded UCs. If I use SimpleView derived control I have not problems. I will get back to you when I have more information and sample on how to overcome this problem.

Kind regards,
Radoslav Georgiev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

This thread is closed