locked
jq ajax not working with web form RRS feed

  • Question

  • Hi   I copied example of ajax and tried to run it. I am using .net 4.6.1  web form. I am getting error: Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

    is this CORS issue? Please help

    <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Ajax._Default" %>
    
    <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    
        <div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>
    
    <button>Get External Content</button>
        <script>
            $(document).ready(
                function () {
                    $('button').click(
    
                    function () {
                        $.ajax({
                            url: "./test.txt",
                            
                            success: function (data) {
    
                                $('#div1').innerHtml = data;
                            }
                        });
                    })
                    }
    );
    
        </script>
    
    </asp:Content>
    

    I am getting run time error:Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

    Friday, March 1, 2019 1:49 PM

All replies

  • Hi Enterprise Library msi not found,

    For web form, Web Form in ASP.NET is the correct form to get support.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 4, 2019 2:01 AM