Modal Tooltip doesnt disable asp panel

2 posts, 0 answers
  1. Atena
    Atena avatar
    1 posts
    Member since:
    Feb 2012

    Posted 03 Apr 2012 Link to this post

    Hello,
    I've created an ASPX page inheriting from Master Page to test a modal tooltip. In the Modality Tooltip demo the browser window is faded out and only the tooltip can be accessed by the user. With my code below however the browser window isn't faded out and the button for example can still be accessed and i get this run time error: "Microsoft JScript runtime error: 'Sys' is undefined"

    Do you have any idea about a solution to this ?

    Thanks for help!

    <%@ Page Title="" Language="C#" MasterPageFile="~/FunctionalityMasterPage.master"
        AutoEventWireup="true" CodeFile="Test_Wait.aspx.cs" Inherits="Test_Wait" %>
      
    <asp:Content ID="Content1" ContentPlaceHolderID="cphHeader" runat="Server">
        <script type="text/javascript">
            //<![CDATA[
            var toHide = false;
            function OnClientBeforeHide(sender, args) {
                if (!toHide) args.set_cancel(true);
            }
      
            function OnClientBeforeShow(sender, args) {
                sender.set_modal(sender.get_modal());
            }
      
            //Attach to event that will indicate when ajax request is complete
            Sys.WebForms.PageRequestManager.getInstance().add_beginRequest
        (
            function (sender, args) {
                toHide = false;
                if (args.get_postBackElement().id == "Button1") {
                    var tooltip = $find("<%=RadToolTip1.ClientID%>");
                    tooltip.show();
                }
            }
        );
            function GetActiveToolTip() {
                var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
                return tooltip;
            }
            //Attach to event that will indicate when ajax request is complete
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest
        (
            function (sender, args) {
                var tooltip = GetActiveToolTip();
                if (tooltip != null && tooltip.get_id() == "RadToolTip1") {
                    toHide = true;
                    tooltip.hide();
                }
            }
        );  
      
        //]]>
        </script>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="cphContent" runat="Server">
     <telerik:RadToolTip ID="RadToolTip1" IsClientID="false" runat="server" Modal="true"
            ShowEvent="FromCode" Position="Center" RelativeTo="BrowserWindow" OnClientBeforeShow="OnClientBeforeShow"
            OnClientBeforeHide="OnClientBeforeHide" Width="140px" EnableShadow="true" HideEvent="FromCode">
            <img src='Images/Icons/loading.gif' alt="loading" style="margin-left: 35px;" />
        </telerik:RadToolTip>
        <asp:Panel ID="Panel1" runat="server" BorderColor="White">
            <table>
                <tr>
                    <td style="width: 50px;">
                    </td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:ImageButton ID="Button1" ImageUrl="Images/Icons/send_sms.png" runat="server"
                                    OnClick="Button1_Click" CssClass="button" Style="display: block; float: left;" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td style="width: 50px;">
                    </td>
                    <td>
                        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </asp:Content>
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 04 Apr 2012 Link to this post

    Hi Atena,

    The "Sys is undefined" error  is a generic one that is not directly related to our controls. It usually happens in an application that is not configured to use AJAX. More information about it is available in this help article (the "Error message "Microsoft JScript runtime error: 'Sys' is undefined"" section) and more general information and links regarding MS AJAX can be found in this help article, as well as in the net, e.g. here or this google search.


    Kind regards,
    Marin
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top