Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在vb.net中从aspx.vb页面调用webmethod_Javascript_Jquery_Asp.net_Vb.net - Fatal编程技术网

Javascript 如何在vb.net中从aspx.vb页面调用webmethod

Javascript 如何在vb.net中从aspx.vb页面调用webmethod,javascript,jquery,asp.net,vb.net,Javascript,Jquery,Asp.net,Vb.net,我想做的是,从aspx.vb调用WebMethod,下面是我的WebMethod语法,它在Default.aspx.vb中 <System.Web.Services.WebMethod()> _ <ScriptMethod(UseHttpGet:=True, ResponseFormat:=ResponseFormat.Json)> _ Public Shared Function dat( _ ByVal Id As Integer) As List(Of items)

我想做的是,从aspx.vb调用WebMethod,下面是我的WebMethod语法,它在Default.aspx.vb中

<System.Web.Services.WebMethod()> _
<ScriptMethod(UseHttpGet:=True, ResponseFormat:=ResponseFormat.Json)> _
Public Shared Function dat( _
ByVal Id As Integer) As List(Of items)
    Dim eve As New List(Of items)()
    eve = (From row In getItems(Id).Rows
           Select New items With {
                                .Name = row("Name").ToString(),
                                .Description = row("Description").ToString(),
                                .ItemPic_url = row("ItemPic_url").ToString()}).ToList()
    Return eve
End Function
下面是我调用web方法的jquery函数:

注意:我的Jquery函数放在母版页中,我从startup Default.aspx页面调用它

问题:我没有输入我的web方法。通过尝试从浏览器调试。我得到的错误如下所述:

Unknown web method dat. Parameter name: methodName at System.Web.Script.Services.WebServiceData.GetMethodData(String methodName) at System.Web.Handlers.ScriptModule.OnPostAcquireRequestState(Object sender, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
我正在做的是从aspx.vb调用WebMethod

下面是我的WebMethod语法,它位于Default.aspx.vb中:

<System.Web.Services.WebMethod()> _
<ScriptMethod(UseHttpGet:=True, ResponseFormat:=ResponseFormat.Json)> _
请看线。也许这对你有帮助。
<System.Web.Services.WebMethod()> _
<ScriptMethod(UseHttpGet:=True, ResponseFormat:=ResponseFormat.Json)> _
Imports System.Web.Services  
Imports System.Web.Script.Services