Autocomplete Component Generates Error - IE : "Operation Aborted"

Last post 12-07-2009 8:32 PM by vnisman. 2 replies.

Sort Posts:

  • Autocomplete Component Generates Error - IE : "Operation Aborted"

    07-02-2008, 2:02 AM
    • Member
      point Member
    • mtn842
    • Member since 04-29-2008, 9:06 PM
    • Posts 3

    I have a ASP.NET 2.0 page with several AJAX controls that work fine. I then added the Autocomplete Extender and started getting periodic "Internet Explorer cannot open the Internet site [http:mysite/...] - Operation Aborted" messesages form IE 6. I would say that 90% of the time it works perfectly fine.

    I have read numerous post but none that seemed to give a simple practical explaination/solution to this problem.

     Here's the relevent code.

     Thanks in Advance,  if anyone can help out ~!

    <asp:TextBox ID="txtAssignedTo" runat="server" Width="180px" ></asp:TextBox>

     

    <asp:RequiredFieldValidator ID="RequiredFieldValidator28" runat="server"

    Display="none"

    ErrorMessage = " Assign To is required"

    ControlToValidate="txtAssignedTo"

    ValidationGroup="Assign" >

    </asp:RequiredFieldValidator>

     

    <ajaxtoolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"

    TargetControlID="txtAssignedTo"

    ServiceMethod="GetEmployees"

    ServicePath="/webservices/Employees1.asmx"

    EnableCaching="false"

    CompletionSetCount="10"

    MinimumPrefixLength="1"

    CompletionListCssClass="completeListStyle"

    CompletionListItemCssClass ="completeItemStyle"

    CompletionListHighlightedItemCssClass = "completeHighlightedStyle"

    OnClientItemSelected="GetCode" >

    </ajaxtoolkit:AutoCompleteExtender>

     --------------------------------------------------

    <script type="text/javascript" language="javascript">function GetCode(source, eventArgs )

    {

    document.getElementById("txtAssignedTo").key = eventArgs.get_value();

    document.getElementById("hidden1").value = eventArgs.get_value();

    }

    </script>

     

     

  • Re: Autocomplete Component Generates Error - IE : "Operation Aborted"

    07-06-2008, 11:16 PM
    Answer

    Hi,

     

    From your description, it seems that you met “Operation Aborted” when you interact with your Web application, right?

     

    This problem occurs because a child container HTML element contains script code that tries to modify the parent container element of the child container. The script code tries to modify the parent container element by using either the innerHTML method or the appendChild method.

     

    To work around this problem, write script blocks that only modify closed containers or that only modify the script's immediate container element. To do this, you can use a placeholder to close the target container, or you can move the script block into the container that you want to modify.

     

    For more deatails or samples on the workaround, see:

     

    http://support.microsoft.com/kb/927917/en-us

     

    Thanks.

     

    Michael Jin.
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Autocomplete Component Generates Error - IE : "Operation Aborted"

    11 minutes ago
    • Member
      4 point Member
    • vnisman
    • Member since 11-10-2009, 11:23 PM
    • Posts 2

    The following is emitted by Asp.Net ScriptManager before other markup and JavaScript on the page (in my case Infragistic’s Grid).

     

    Sys.Application.add_init(function() {
        $create(AjaxControlToolkit.AutoCompleteBehavior, /*Initialization code for the autocompleteextender here*/);

    This way on a slow connection ms ajax application object starts up before IG is done tweaking the html DOM and IE fails.

     

    The best solution to this problem that I was able to find after a couple days of debugging is the following:

    Put the following script in a js file that is loaded after ms ajax script is loaded:

     

    // Delay Ajax Intitialization

    var ajaxInitialize = Sys.Application.initialize;

    Sys.Application.initialize = function DoNothing() { }

     

    Put the following code in asp.net base page (alternatively this script could be put directly in the page markup at the end of the page - after IG Grid or any other controls are completely loaded):

     

            protected override void RenderChildren(HtmlTextWriter writer)

            {

                base.RenderChildren(writer);

     

                writer.Write("<script type='text/javascript'>");

                writer.Write("Sys.Application.initialize = ajaxInitialize;");

                writer.Write("Sys.Application.initialize();");

                writer.Write("</script>");

            }

     

Page 1 of 1 (3 items)