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

Modal Tooltip doesnt disable asp panel

1 Answer 47 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Atena
Top achievements
Rank 1
Atena asked on 03 Apr 2012, 10:28 AM
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>

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 04 Apr 2012, 11:19 AM
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.
Tags
ToolTip
Asked by
Atena
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or