RadProgressManager OnClientProgressStarted running on any RadAjax postback

Thread is closed for posting
5 posts, 1 answers
  1. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 12 Jan Link to this post

    Hi,

    I am using version 2015.1.401.40 of the ASP.NET for AJAX controls.

    I have an ascx control that contains the RadUpload control along with a RadProgressArea and a RadProgressManager.

    I have it in an aspx file that uses the RadAjaxManager and the aspx control also contains many other ascx controls.

    Many of the ascx controls are being updated by the RadAjaxManager...

    PROBLEM:

    When I do anything on the aspx form that does an ajax postback, the OnClientProgressStarted event is being fired on the RadProgressManager.

    As an example, I have an ajaxed ascx control that contains a telerik radgrid and when I put a row into edit mode on that grid, the OnClientProgressStarted event is fired on the RadProgressManager.  I know that, because I call a javascript function from it and have put a debugger statement in it...

    This causes totally undesirable behavior.  I only want that event to fire when I'm using the upload control...

    Q. Can you tell me if there is anything I can do to try to correct this behavior and NOT have OnClientProgressStarted fired on every ajax postback on the page?

    Thanks,

    Brent

  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 15 Jan Link to this post

    Hi Brent,

    Please look here: http://docs.telerik.com/devtools/aspnet-ajax/controls/progressarea/progress-monitoring-with-ajax If this doesn't help please attach sample project, so we can review your code.

    Regards,
    Hristo Valyavicharski
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 15 Jan in reply to Hristo Valyavicharski Link to this post

    Hi Hristo,

    Thanks for the reply, but the content in that link doesn't have anything to do with my post.

    I understand why you want a sample application... but I don't have time to stop and put something together and there may be many factors involved in the the cause of my problem. So to workaround the problem for now, when I use my ascx control that contains the upload control in the scenario that causes the problem, I simply don't assign a javascript function call to the OnClientProgressStarted event.

    I'll consider this closed / unanswered, as I don't think any of us has time to spend on pursuing the cause / resolution.

    Regards,

    Brent

  5. Answer
    Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 19 Jan Link to this post

    Hi Brent,

    I managed to reproduce this behavior with the following code:
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <Scripts>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                </Scripts>
            </telerik:RadScriptManager>
            <telerik:RadAjaxManager runat="server" ID="ajaxManager">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnAjax">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="progressManager" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadProgressManager
                runat="server"
                ID="progressManager"
                OnClientProgressStarted="OnClientProgressStarted"></telerik:RadProgressManager>
            <telerik:RadButton runat="server" ID="btnAjax" Text="Ajax" />
            <script type="text/javascript">
                function OnClientProgressStarted(sender, args) {
                    console.log('onClientProgressStarted');
                }
            </script>

    Actually this is not error. By default the RadProgressManager handles the submit event of the form. That's why the OnClientProgressStarted event is fired and ajax call. This what you could do is to set the RegisterForSubmit property to false.

            <telerik:RadProgressManager
                runat="server"
                RegisterForSubmit="false"
                ID="progressManager"
                OnClientProgressStarted="OnClientProgressStarted">
            </telerik:RadProgressManager>

    But you will have to start progress manually:

    var progressManager = $find("progressManager ");
    progressManager.startProgressPolling();

    Regards,
    Hristo Valyavicharski
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 19 Jan in reply to Hristo Valyavicharski Link to this post

    Thanks for the extra effort Hristo. I think I will go with my workaround. When I use that control with other controls that do postbacks, I'll simply NOT assign a javascript function to the OnClientProgressStarted event. I was only doing that to display a modal div to prevent other things from being clicked... not a big deal.

    Thanks again for the follow up.

    Brent

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017