'Sys' is undefined

Last post 11-25-2008 2:20 PM by mvang. 3 replies.

Sort Posts:

  • 'Sys' is undefined

    11-24-2008, 10:15 PM
    Locked

    I have been trying to implement the ModalPopupExtender using VWD with .NET version 3.5, and I get a javascript error "'Sys' is undefined".  My page is a very simple test page, so I will include it in its entirety:

    <%@ Page Language="VB" %>

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

    <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        Namespace="System.Web.UI" TagPrefix="asp" %>


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

    <script runat="server">

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:Panel ID="Panel1" runat="server" style="display:none;">
                <h1>This is a popup</h1>
                <asp:Button ID="btnOK" runat="server" Text="OK" />
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
            </asp:Panel>
            <input type="button" id="btnShowPopup" value="Show Popup" runat="server"/>
        </div>
        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1"
        TargetControlID="btnShowPopup" CancelControlID="btnCancel" BehaviorID="ModalPopupExtender1" OkControlID="btnOK">
        </cc1:ModalPopupExtender>
        </form>
    </body>
    </html>

     I found a posting somewhere that suggested adding some code to the <HTTPHandlers> section of Web.Config, but this had no effect.

    Any ideas how I can fix this?

    Thanx.

     Sheldon

  • Re: 'Sys' is undefined

    11-24-2008, 11:13 PM
    Answer
    Locked

    I think this quesiton has Most replies for a thread. Just read it. it may help you. 

     http://forums.asp.net/p/1040236/1446560.aspx

    Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
  • Re: 'Sys' is undefined

    11-25-2008, 10:11 AM
    Locked

    I read the thread you directed me to and found it extremely depressing.  It is full of suggestions for possible solutions.  I tried a few of them to no avail.

    It's disturbing to see a thread that has gone on for two years and hundreds of entries and still has not arrived at a definitive solution to what is apparently a very common problem.  Microsoft should dig into this problem and publish a knowledge base article that includes a solution.

  • Re: 'Sys' is undefined

    11-25-2008, 2:20 PM
    Answer
    Locked
    • Participant
      1,708 point Participant
    • mvang
    • Member since 12-27-2007, 1:59 PM
    • Mid West
    • Posts 361

    Well, the error can be numerous reason and thus, the link had many entries of individual envoirnments & set up that contributed to their Sys undefined error as well. The common is the fact that the scriptManager id not render before the controls - thus, it needs to be placed at the very top of all forms. Another reason is if the dll is not in the bin folder. If you are scripting against the Scriptmanager, the script has to come after the form tag as well if you are placing the script in the source code rather than attaching it as an external file. That also could result in the error. Well, the code sample looks good from what I can see. Sorry I am not much help.

    "If you have knowledge, let others light their candles in it."
    — Margaret Fuller
Page 1 of 1 (4 items)