AutoCompleteExtender vs ValidatorCalloutExtender

Last post 12-22-2006 6:48 PM by David Anson. 5 replies.

Sort Posts:

  • AutoCompleteExtender vs ValidatorCalloutExtender

    12-18-2006, 5:40 AM

    If both AutoCompleteExtender and ValidatorCalloutExtender are present on same page, error occurred during page unload.

    1    <%@ Page Language="C#" AutoEventWireup="true" Inherits="Test_Default" Codebehind="Default.aspx.cs" %>
    2    
    3    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    4    <html xmlns="http://www.w3.org/1999/xhtml">
    5    <head id="Head1" runat="server">
    6    </head>
    7    <body>
    8    	<form id="form1" runat="server">
    9    		<asp:ScriptManager ID="ScriptManager1" runat="server" />
    10   		<asp:TextBox ID="BccTextBox" runat="server" TextMode="SingleLine" ReadOnly="true" />
    11   		<%--Validator.--%>
    12   		<asp:RegularExpressionValidator ID="BccValidator" runat="server" ControlToValidate="BccTextBox"
    13   			Display="None" EnableClientScript="true" ValidationExpression="\d+, \d+, \d+, \d+" />
    14   		<%--Validator callout extender.--%>
    15   		<AjaxToolkit:ValidatorCalloutExtender ID="BccValidatorCalloutExtender" runat="server"
    16   			TargetControlID="BccValidator" Width="350px" />
    17   		<asp:TextBox ID="ExpenseFormTextBox" runat="server" />
    18   		<%--Auto complete extender.--%>
    19   		<asp:AutoCompleteExtender ID="ExpenseFormAutoCompleteExtender" runat="server" MinimumPrefixLength="1"
    20   			ServicePath="~/Common/Controls/BudgetClassificationCodes/AutoCompleteService.asmx"
    21   			ServiceMethod="GetExpenseFormsCodes" TargetControlID="ExpenseFormTextBox" EnableCaching="true" />
    22   	</form>
    23   </body>
    24   </html>
    25   
    

    Microsoft JScript: Sys.ArgumentUndefinedException: Value cannot be undefined.
    Parameter name: element

    Sys.UI.DomElement.getVisible = function Sys$UI$DomElement$getVisible(element) {
        /// <param name="element" domElement="true"></param>
        /// <returns type="Boolean"></returns>
        var e = Function._validateParams(arguments, [
            {name: "element", domElement: true}
        ]);
        if (e) throw e;
    
        return (element.style.visibility !== 'hidden');
    }

     Call stack:

    > Sys$UI$DomElement$getVisible JScript
      JScript anonymous function JScript
      Sys$_Application$dispose JScript
      Sys$_Application$_unloadHandler JScript
      JScript anonymous function JScript
      JScript anonymous function JScript

    Ajax RC1.
    Ajax Features Dec.
    Ajax Control Toolkit 61214 Production.

  • Re: AutoCompleteExtender vs ValidatorCalloutExtender

    12-19-2006, 11:37 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-10-2006, 9:39 PM
    • Microsoft
    • Posts 1,842
    • AspNetTeam

    Fantastic problem report, Cyril! I see you opened work item 6600 to track this - I've just closed it with a note that it's a duplicate of work item 4598 which contains the following summary that resulted from my recent investigation:

    The problem is that the PreviewScript.js file that comes with the ASP.NET 2.0 AJAX Futures November CTP that contains AutoCompleteExtender contains its own definitions of Sys.UI.DomElement.get/setVisible which don't work the same as (as well as) the ones the Toolkit defines in Blocking.js. Depending on the load order of the controls in the page, one or the other behavior will be used (flipping HoverMenu and AutoCompleteExtender in the sample page fixes the problem for this reason). Assuming we want to keep our own implementation safe, we should probably change the name to something unique. Clearing "Assigned To" field so we'll see this during the next bug review.

    Again, great to see the well-written problem report, thanks!


    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: AutoCompleteExtender vs ValidatorCalloutExtender

    12-20-2006, 12:36 AM
    Answer
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-10-2006, 9:39 PM
    • Microsoft
    • Posts 1,842
    • AspNetTeam

    Slight correction, sorry about that. Here are my latest comments to work item 6600:

    Okay, it's a duplicate of 5957, instead. :) From my description there:

    "This problem has been fixed in the Development branch by change 10601 which adds a check for non-nullness to the result of this.get_element() in AjaxControlToolkit.PopupBehavior's dispose method. This fix is not present in the 61214 release of the Toolkit, but can be easily made to that source code as well by users who encounter this problem. The problem comes about when a PopupBehavior is hosted by another behavior and disposed by that other behavior's dispose method. When ASP.NET AJAX calls the page's dispose handlers the PopupBehavior will be disposed twice - once via a call from its hoster's dispose method and once via a call to its own. Without the check of this.get_element() for non-nullness, PopupBehavior's dispose method can't be called multiple times and causes the script error reported here.

    The fix to the Release branch's implementation adds "elt && " to two places and the resulting code should look something like:

    ..."

    The weirdness with AutoCompleteExtender that this work item highlights - and the tie-in to work item 4598 I initially pointed to - comes about because the same-named PopupBehavior defined in the Features CTP doesn't have the dispose bug mentioned above. So including AutoCompleteExtender may mask the problem by replacing the buggy dispose method in the Toolkit with one that doesn't have the bug from the CTP. But the underlying issue's still there even if it's not encountered sometimes (essentially by chance).


    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: AutoCompleteExtender vs ValidatorCalloutExtender

    12-20-2006, 4:45 AM

    This problem has been fixed in the Development branch by change 10601

    Is it change set from source code tab on codeplex?

    And which way are releases maked up? Are there two branches for release and dev? If yes, which one publicated on codeplex?

  • Re: AutoCompleteExtender vs ValidatorCalloutExtender

    12-20-2006, 7:38 AM
    I think I got it. where are both branches.
  • Re: AutoCompleteExtender vs ValidatorCalloutExtender

    12-22-2006, 6:48 PM
    • Star
      8,710 point Star
    • David Anson
    • Member since 04-10-2006, 9:39 PM
    • Microsoft
    • Posts 1,842
    • AspNetTeam
    The downloads at http://www.codeplex.com/AtlasControlToolkit/SourceControl/ListDownloadableCommits.aspx should have a Development and a Release directory at the top level - the Development directory is the Development branch which has newer stuff that's under development.

    http://blogs.msdn.com/delay

    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (6 items)