This project is archived and is in readonly mode.

#1045 ✓hold
Igor

asp net bug

Reported by Igor | October 18th, 2010 @ 11:24 AM | in 2.0 (closed)

ASP.NET

<head>
<script src="*/js/mootools-core-1.3.js" type="text/javascript"></script>
</head>

then connected Script Manager on page:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptLocalization="true">
</asp:ScriptManager>

Firebug error: "Sys.Res is undefined".

With mootools-1.2.4.4-core.js it was ok...

Type.prototype.registerEnum = function Type$registerEnum(name, flags) {
1630 /// <summary locid="M:J#Sys.UI.LineType.#ctor" />
1631 /// <param name="name" type="String"></param>
1632 /// <param name="flags" type="Boolean" optional="true"></param>
1633 var e = Function._validateParams(arguments, [
1634 {name: "name", type: String},
1635 {name: "flags", type: Boolean, optional: true}
1636 ]);
1637 if (e) throw e;
1638 if (!Type.__fullyQualifiedIdentifierRegExp.test(name)) throw Error.argument('name', Sys.Res.notATypeName);
1639 var parsedName;
1640 try {
1641 parsedName = eval(name);
1642 }
1643 catch(e) {
1644 throw Error.argument('name', Sys.Res.argumentTypeName);
1645 }
1646 if (parsedName !== this) throw Error.argument('name', Sys.Res.badTypeName);
1647 if (Sys.__registeredTypes[name]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, name));
1648 for (var j in this.prototype) {
1649 var val = this.prototype[j];
1650 if (!Type.__identifierRegExp.test(j)) throw Error.invalidOperation(String.format(Sys.Res.enumInvalidValueName, j));
1651 if (typeof(val) !== 'number' || (val % 1) !== 0) throw Error.invalidOperation(Sys.Res.enumValueNotInteger);
1652 if (typeof(this[j]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.enumReservedName, j));
1653 }
1654 Sys.__upperCaseTypes[name.toUpperCase()] = this;
1655 for (var i in this.prototype) {
1656 this[i] = this.prototype[i];
1657 }
1658 this.__typeName = name;
1659 this.parse = Sys$Enum$parse;
1660 this.__string = this.toString();
1661 this.toString = Sys$Enum$toString;
1662 this.__flags = flags;
1663 this.__enum = true;
1664 Sys.__registeredTypes[name] = true;
1665}

Comments and changes to this ticket

  • Igor
  • Thomas Aylott

    Thomas Aylott October 25th, 2010 @ 05:40 PM

    • Tag set to asp.net
    • Assigned user set to “Thomas Aylott”

    Do you have a live example of this issue hosted anywhere?
    Or could you possibly save the rendered page with all its resources into a zip or something and attach it?

    There's no way for me to debug this issue without having access to a testable page.

    Thanks much.

  • Igor

    Igor October 25th, 2010 @ 07:15 PM

    i will try to create a test area

  • Igor

    Igor October 26th, 2010 @ 01:55 PM

    http://gastronom.ru/111/test.aspx?script1=test&amp;script2=test&amp...
    e.t.c
    http://gastronom.ru/111/test.aspx?script1=http://static.gastronom.r...

    bug on link:
    http://gastronom.ru/111/test.aspx?script1=http://static.gastronom.r...


    %@Page Language="C#" AutoEventWireup="true" %>

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



    {mkd-extraction-e45b140b0a693981386983331163affb}



    {mkd-extraction-2a68c7bfcebb8a707ed99c483da50012}


  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 05:52 PM

    I believe the MS stuff brings a Type variable - in that case there is nothing we can do about this.

  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 06:56 PM

    • State changed from “new” to “hold”
    • Milestone set to 1.3.1
    • Milestone order changed from “810” to “0”
  • Igor

    Igor November 9th, 2010 @ 10:09 PM

    omg, You're killing me. I like your work and mootools. There's no sense in working with mootools because of this small bug. I had no intension to start working in jquery… but you leave me no other options.

    Is there any way to compile the new library without Type?

  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 10:35 PM

    This seems very unfortunate. Without type is certainly impossible because it is one of the central features of 1.3. Everything is based on Type. You can of course try renaming every occurrence of Type and build your own version of MooTools. As Type is kinda new, only few third party actually rely on it. If thats your thing you should definitely try going the way of having a custom build with 'MooType' or whatever.

    Not sure if Thomas gets around to take a deeper look into this, maybe there is a nice way to fix this. Have you tried loading Moo after all third party scripts?

  • Igor

    Igor November 10th, 2010 @ 10:59 AM

    Yes the error disappears. But this is not a good solution for me. Would be more correct to rename a variable. Christoph, advise how to rename:
    - do "No Compression" version of assemblies - global change (Find and Replace) rename: from "Type" to "mType" or from "Type." to "mType." or * from "Type(" to "mType("? with Case Sensitivity

    This is not the first conflict situation with MS scripts. You are now going to very expensive and far away from $-functions moved to the objects. Perhaps there are options to provide procedures for the protection of variables and functions. The user to rename itself the variables and objects in the assembly? (More detailed assembly)

  • Igor

    Igor November 10th, 2010 @ 01:53 PM

    my attempts to rename the Type and other variables were not successful
    but i found the solution :D

    Function.implement "hide: function(){" renamed to "hide2: function(){"
    and global replace "hide()" to "hide2()"

    // hide, protect
    
    Function.implement({
    
        hide2: function(){
            this.$hidden = true;
            return this;
        },
    
        protect: function(){
            this.$protected = true;
            return this;
        }
    
    });
    

    result http://gastronom.ru/111/test.aspx?script1=mootools-core-1.3.js&amp;...

    okay Christoph, could you tell me if you are going to rename the function "hide"?

  • ofertal

    ofertal November 19th, 2010 @ 10:02 PM

    I also ran into the same issue today. renaming the hide function to anything (makeHidden) was my choice in mootools.core seems to solve this.

    Since AFAIK Function.hide() isn't a function documented in mootools docs, would it be possible to officially rename it in the mootools codebase so that it won't conflict with Microsoft ajax?

    Thank you

  • Christoph Pojer

    Christoph Pojer February 23rd, 2011 @ 12:57 PM

    • Milestone changed from 1.3.1 to 1.4.0
    • Milestone order changed from “5” to “0”
  • Duarte Carreira

    Duarte Carreira April 26th, 2011 @ 01:28 PM

    I think this is really unfortunate. Mootools at version 1.3 introduced a huge incompatibility with a pre-existing, on of the most used, framework. And it seems there's not going to be a way to fix this. I was also taken by surprise with this, as Type sudenly stopped having the expected methods and started having a few others brought by moo.

    This is really, really unfortunate, and could have been easily avoided. Not having a solution for this just eliminates mootools from every aspx site out there. I for one feel very sad with this situation, since mootools is such a great lib.

    I just want to ask the team to reconsider and find a solution for this situation. Some way to coexist with aspx.

    Thanks,
    Duarte

  • Christoph Pojer

    Christoph Pojer August 13th, 2011 @ 12:55 AM

    • Milestone changed from 1.4.0 to 2.0
    • Milestone order changed from “3” to “0”

    This will be fixed in MooTools 2.0

  • Scott

    Scott September 8th, 2011 @ 04:04 PM

    Though this issue is an unfortunate one I was able to update my "mootools-core-1.3.2-full-nocompat(1).js" and "mootools-more-1.3.2.1(1).js".

    Start in core, and replace Type with mooType. Do a search for "// Type" Change it to mooType don't forget to rename the this.Type to this.mooType too, then do a search for "new Type(" and replace with "new mooType(", then do a search for "Type." and replace with "mooType." .

    then go into your more file and search for "new Type(" and replace with "new mooType(" and search for "Type." and replace with "mooType."

    that should do it, and works fine now for me with scriptManager .net 4.0 in my aspx pages.

    And then wait for mootools V2.0

    I'll attach my updated files if anyone wants them.

    Gafa

  • Satish

    Satish October 20th, 2011 @ 04:05 PM

    Hi,

    Is there any way we can get updated version of Validation and Imask plugin for ASP.NET

    Thanks
    Satish

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Tags

Pages