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

Error sys is undefined

2 Answers 153 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aniket
Top achievements
Rank 1
Aniket asked on 28 Dec 2015, 11:01 PM

I am following this tutorial here and created a page but popup won't show when I click the button. I am getting javascript error sys is undefined. 

Tutorial: http://demos.telerik.com/aspnet-ajax/window/examples/modalpopup/defaultcs.aspx

aspx

 

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FNA.NRTT.Website.Customer.Portfolio.Default" %>
<%@ Register TagPrefix="nrtt" TagName="CustomerGrid" Src="~/UserControls/CustomerGrid.ascx" %>
<%@ Register TagPrefix="nrtt" TagName="DisplayClientDefinedField" Src="~/UserControls/DisplayClientDefinedField.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <h2><asp:Literal ID="ltPageTitle" runat="server" Text="<%$ Resources:NrttLanguage, Portfolio %>"></asp:Literal></h2>
    <nrtt:DisplayClientDefinedField runat="server" ID="ucDisplayCDFS" OnNeedCdfDefinitions="ucDisplayCDFS_NeedCdfDataDefinition" OnFilterChanged="ucDisplayCDFS_FilterCDFS"/>
    <asp:Button ID="rbEdit" Text="Edit" runat="server"/>
    <nrtt:CustomerGrid ID="ucExpiringRealServices" runat="server" AllowSelection="true" OnNeedDataSource="ucExpiringRealServices_NeedDataSource" OnNeedColumnCollection="ucExpiringRealServices_NeedColumnCollection" OnItemDataBound="ucExpiringRealServices_ItemDataBound" ></nrtt:CustomerGrid>
    <telerik:RadWindow ID="modalPopup" runat="server" Width="360px" Height="360px" Modal="true" OffsetElementID="main">
        <ContentTemplate>
            <div style="padding: 10px; text-align: center;">
                <telerik:RadButton ID="rbToggleModality" Text="Toggle modality" OnClientClicked="togglePopupModality"
                    AutoPostBack="false" runat="server" Height="65px" />
            </div>
            <p style="text-align: center;">
                RadWindow is designed with keyboard support in mind - try tabbing
                    before and after removing the modal background. While the popup is modal
                    you cannot focus the text area, once the modality is removed the text area will
                    be the first thing to receive focus because it has tabIndex=1.
            </p>
        </ContentTemplate>
    </telerik:RadWindow>
     
</asp:Content>

 

javascript:

var demo = {};
 
function togglePopupModality() {
    var wnd = getModalWindow();
    wnd.set_modal(!wnd.get_modal());
 
    if (!wnd.get_modal()) {
        document.documentElement.focus();
    }
}
function showDialogInitially() {
    var wnd = getModalWindow();
    wnd.show();
    Sys.Application.remove_load(showDialogInitially);
}
Sys.Application.add_load(showDialogInitially);
 
function getModalWindow() { return $find(demo.modalWindowID); }
 
global.$modalWindowDemo = demo;
global.togglePopupModality = togglePopupModality;

2 Answers, 1 is accepted

Sort by
0
Aniket
Top achievements
Rank 1
answered on 29 Dec 2015, 02:47 PM

I am also following this to update web.config but updating web.config won't work.

 http://ajax.asp.net/ajax/documentation/live/ConfiguringASPNETAJAX.aspx#systemwebserver

0
Accepted
Pavlina
Telerik team
answered on 30 Dec 2015, 04:26 PM
Hello,

Take a look to the following links for more information about this error - Common reasons for the ‘Sys is undefined’ error in ASP.NET Ajax applications: http://www.telerik.com/blogs/common-reasons-for-the-lsquo-sys-is-undefined-rsquo-error-in-asp-net-ajax-applications and General Troubleshooting article: 
http://docs.telerik.com/devtools/aspnet-ajax/general-information/troubleshooting/general-troubleshooting#error-message-microsoft-jscript-runtime-error-sys-is-undefined

Regards,
Pavlina
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
Tags
General Discussions
Asked by
Aniket
Top achievements
Rank 1
Answers by
Aniket
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or