user3405362
user3405362

Reputation: 11

Uncaught ReferenceError: PageMethods is not defined

I've been looking for the answer to this (Uncaught ReferenceError: PageMethods is not defined ) but I have not found it yet.

I have this: Buscador.aspx when I call a javascript function BuscarProductos()

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Buscador.aspx.vb" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script src="js/inicio.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>

    <input type="text" id="productobuscado"/>
    <input type="button" id="boton" value="presionar"  onclick="BuscarProductos()" />

    <div id="capa"></div>
</asp:Content>

In Javascript I have this

function BuscarProductos() {
    var prodct = document.getElementById("productobuscado");
    PageMethods.BuscarTurbos(prodct.value, BuscarProductos_ok, BuscarProductos_ko);
}
    
function BuscarProductos_ok(resul) {
    document.getElementById("capa").innerHTML=resul;
}

function BuscarProductos_ko(resul) {
    alert(resul);
}

And in code behind I have

Imports System.Web.Services


Partial Class _Default
    Inherits System.Web.UI.Page
    
    <WebMethod()> _
    Public Shadows Function BuscarTurbos(referencia As String) As String

        Return "hello this is a test" + referencia
    End Function


End Class

but I have this error:

Failed to load resource: net::ERR_NAME_NOT_RESOLVED https://frog-stats.com/count/cpmapgelcjnnpnblchplnadokgmamdbk

Uncaught ReferenceError: PageMethods is not defined

Upvotes: 0

Views: 3516

Answers (1)

Muhammad Osmond
Muhammad Osmond

Reputation: 127

It's looks like that your link( https://frog-stats.com/count/cpmapgelcjnnpnblchplnadokgmamdbk) is temporarily down or isn't available. So the browser can't load the data inside it.

Upvotes: 1

Related Questions