Ajaxmanagerproxy vs button disable

5 posts, 1 answers
  1. Mark
    Mark avatar
    36 posts
    Member since:
    Mar 2014

    Posted 28 May Link to this post

    Hello

    I have an issue with RadajaxManagerProxy in a Masterpage/contentpage setup. 
    My goal is to enable/disable (save/update/email) buttons upon saving/updating a telerik report.

    The code provided below works just fine when executed under no load.

    But during the day with multiple users online, the script stops enabling/disabling the buttons. 
    (savereport and other heavy rutines still works)

    Is my approach incorrect for the task?
    Any help would be highly  appreciated.

     

    regards

    Mark

    Master.aspx----------------------------------------------------------------
    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MP.master.cs" Inherits="MP" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
            <Scripts>       
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
                    Name="Telerik.Web.UI.Common.Core.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
                    Name="Telerik.Web.UI.Common.jQuery.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" 
                    Name="Telerik.Web.UI.Common.jQueryInclude.js">
                </asp:ScriptReference>                   
            </Scripts>  
        </telerik:RadScriptManager>
         
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>            
            </AjaxSettings>
        </telerik:RadAjaxManager>
        

     <telerik:RadAjaxLoadingPanel ID="generalRadAjaxLoadingPanel" runat="server"  Skin="Silk" InitialDelayTime="700" >
        </telerik:RadAjaxLoadingPanel>


        <div>
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
            
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>

    CP.aspx--------------------------------------------------------

    <%@ Page Title="" Language="C#" MasterPageFile="~/MP.master" AutoEventWireup="true"
        CodeFile="CP.aspx.cs" Inherits="Default3" %>

        <%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=9.0.15.324, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
        Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
      

    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="but_Update">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="but_Email" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="but_Save" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="ReportViewer1" UpdatePanelCssClass="" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="but_Save">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="but_Email" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="but_Save" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="ReportViewer1" UpdatePanelCssClass="" LoadingPanelID="generalRadAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">

                $(document).ready(function () {

                });


                function OpenQuoteEmail() {
                    alert('Email Dialog');
                }
               

            </script>
        </telerik:RadCodeBlock>
        <table runat="server" border="0" id="maintable" clientidmode="Static" style="width: 100%;">
            <tr>
                <td style="width: 250px;" valign="top">
                    <table width="250" border="0">
                        <tr>
                            <td>
                                <asp:Button ID="but_Update" runat="server"  Text="Update"
                                    Width="250px" OnClick="butUpdate_Click" TabIndex="109" />
                                <br />
                                <br />
                                <asp:Button ID="but_Email" runat="server"  Text="E-Mail" Width="250px"
                                    ClientIDMode="Static" OnClientClick="OpenQuoteEmail(); return false;" TabIndex="110" />
                                <br />
                                <br />                           
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <asp:Button ID="but_Save" runat="server"  Text="Save"
                                                Width="110px" OnClick="butSave_Click" TabIndex="120" />
                                        </td>
                                        <td>
                                            <asp:Button ID="but_Cancel" runat="server"  Text="Close" Width="110px"
                                                OnClick="butCancel_Click" TabIndex="121" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
                <td valign="top" style="height: 100%;">
                    <div id="rp">
                        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="1200px" Width="100%"
                            ShowParametersButton="False" ShowHistoryButtons="False" BorderColor="Gray" BorderStyle="Solid"
                            BorderWidth="1px" ViewMode="PrintPreview" ShowRefreshButton="False" ShowPrintPreviewButton="False"
                            TabIndex="99">
                        </telerik:ReportViewer>
                    </div>
                </td>
            </tr>
        </table>
    </asp:Content>



    CP.cs---------------------------------------------------------------------------

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public partial class Default3 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            but_Email.Enabled = false;
            but_Email.ToolTip = "Please save document before opening email dialog";

        }


        protected void butSave_Click(object sender, EventArgs e)
        {
            but_Save.Enabled = false;
            but_Email.Enabled = true;
            but_Email.ToolTip = "";

           // SavePrintSettings();
           // SaveReports();
           
        }

        protected void butUpdate_Click(object sender, EventArgs e)
        {      
            but_Save.Enabled = true;
            but_Email.Enabled = false;
            but_Email.ToolTip = "Save before opening email dialog";

            // LoadReport();
        }

        protected void butCancel_Click(object sender, EventArgs e)
        {

        }
    }

  2. Mark
    Mark avatar
    36 posts
    Member since:
    Mar 2014

    Posted 28 May Link to this post


    Here is the code in prettyformat:

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MP.master.cs" Inherits="MP" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
     
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>      
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.Core.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.jQuery.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.jQueryInclude.js">
                </asp:ScriptReference>                  
            </Scripts
        </telerik:RadScriptManager>
          
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>           
            </AjaxSettings>
        </telerik:RadAjaxManager>
         
     
     <telerik:RadAjaxLoadingPanel ID="generalRadAjaxLoadingPanel" runat="server"  Skin="Silk" InitialDelayTime="700" >
        </telerik:RadAjaxLoadingPanel>
     
     
        <div>
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
             
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>
     
    CP.aspx--------------------------------------------------------
     
    <%@ Page Title="" Language="C#" MasterPageFile="~/MP.master" AutoEventWireup="true"
        CodeFile="CP.aspx.cs" Inherits="Default3" %>
     
        <%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=9.0.15.324, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
        Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
       
     
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="but_Update">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="but_Email" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="but_Save" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="ReportViewer1" UpdatePanelCssClass="" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="but_Save">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="but_Email" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="but_Save" UpdatePanelCssClass="" />
                        <telerik:AjaxUpdatedControl ControlID="ReportViewer1" UpdatePanelCssClass="" LoadingPanelID="generalRadAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
     
                $(document).ready(function () {
     
                });
     
     
                function OpenQuoteEmail() {
                    alert('Email Dialog');
                }
                
     
            </script>
        </telerik:RadCodeBlock>
        <table runat="server" border="0" id="maintable" clientidmode="Static" style="width: 100%;">
            <tr>
                <td style="width: 250px;" valign="top">
                    <table width="250" border="0">
                        <tr>
                            <td>
                                <asp:Button ID="but_Update" runat="server"  Text="Update"
                                    Width="250px" OnClick="butUpdate_Click" TabIndex="109" />
                                <br />
                                <br />
                                <asp:Button ID="but_Email" runat="server"  Text="E-Mail" Width="250px"
                                    ClientIDMode="Static" OnClientClick="OpenQuoteEmail(); return false;" TabIndex="110" />
                                <br />
                                <br />                          
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <asp:Button ID="but_Save" runat="server"  Text="Save"
                                                Width="110px" OnClick="butSave_Click" TabIndex="120" />
                                        </td>
                                        <td>
                                            <asp:Button ID="but_Cancel" runat="server"  Text="Close" Width="110px"
                                                OnClick="butCancel_Click" TabIndex="121" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
                <td valign="top" style="height: 100%;">
                    <div id="rp">
                        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="1200px" Width="100%"
                            ShowParametersButton="False" ShowHistoryButtons="False" BorderColor="Gray" BorderStyle="Solid"
                            BorderWidth="1px" ViewMode="PrintPreview" ShowRefreshButton="False" ShowPrintPreviewButton="False"
                            TabIndex="99">
                        </telerik:ReportViewer>
                    </div>
                </td>
            </tr>
        </table>
    </asp:Content>
     
     
     
    CP.cs---------------------------------------------------------------------------
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    public partial class Default3 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            but_Email.Enabled = false;
            but_Email.ToolTip = "Please save document before opening email dialog";
     
        }
     
     
        protected void butSave_Click(object sender, EventArgs e)
        {
            but_Save.Enabled = false;
            but_Email.Enabled = true;
            but_Email.ToolTip = "";
     
           // SavePrintSettings();
           // SaveReports();
            
        }
     
        protected void butUpdate_Click(object sender, EventArgs e)
        {     
            but_Save.Enabled = true;
            but_Email.Enabled = false;
            but_Email.ToolTip = "Save before opening email dialog";
     
            // LoadReport();
        }
     
        protected void butCancel_Click(object sender, EventArgs e)
        {
     
        }
    }
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 31 May Link to this post

    Hello,

    Can you please try to remove all the ajax settings from the applictaion and let me know if any difference in the presented behvaiour appears?

    Regards,
    Maria Ilieva
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  5. Mark
    Mark avatar
    36 posts
    Member since:
    Mar 2014

    Posted 31 May in reply to Maria Ilieva Link to this post

    I have tried removing ajax, it works fine, also under load.

     

  6. Answer
    Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 03 Jun Link to this post

    Hello Mark,

    Can you please make sure that you are using the latest official version of the controls. We have similar bug in previous version which is already fixed in the latest official releases? Please upgrade your application to it and see how it goes.

    Regards,
    Maria Ilieva
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017