English 中文(简体)
net 2.0 ajax jquery pagemethod 404 Object not found
原标题:.net 2.0 ajax jquery pagemethod 404 object not found

我的主页,即

<head>
<script type="text/javascript">
$(document).ready(function() {
$("#result").click(function() {
$.ajax({type: "POST",url: "ws.aspx/HelloWorld",data: "{}",contentType: "application/json; charset=utf-8",dataType: "json",success: function(msg) {
$("#result").text(msg.d);
}
});
});
</script>
</head>
<body>
<form>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" />
<div name="result" id="result">long clicky text</div>
</form>
</body>

在我的下页上,除总页外,没有总页数,是空的。

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ws.aspx.vb" Inherits="CRTWebApp.ws" %>

<html>
<head>
</head>
<body>
</body>

在我的手脚中,它被宣布为类似。

<System.Web.Services.WebService()> _ 
Partial Public Class ws
 Inherits System.Web.UI.Page

<System.Web.Services.WebMethod()> _ 
<System.Web.Script.Services.ScriptMethod(ResponseFormat:=Script.Services.ResponseFormat.Json)> _
        Public Shared Function HelloWorld() As String
            Return "hello world"
        End Function
    End Class

在大火中,如果一点点点点点击“长点”的文字,情况就是如此。

POST HelloWorld 404 Object Not Found

ws.aspx处于同一个十字路口,其 sp光是正确的,可以超过该页(尽管是空的)。

此处是请求和答复

Response Headers
Server  Microsoft-IIS/5.1
Date    Wed, 15 Sep 2010 21:43:37 GMT
WWW-Authenticate    Negotiate NTLM
Connection  close
Content-Length  4431
Content-Type    text/html

Request Headers
Host    localhost
User-Agent  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 (.NET CLR 3.5.30729)
Accept  application/json, text/javascript, */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive  115
Connection  keep-alive
Content-Type    application/json; charset=utf-8
X-Requested-With    XMLHttpRequest
Referer http://localhost/CRTWebApp/SysAdmin/cat.aspx?lang=en
Content-Length  2
Cookie  ASP.NET_SessionId=clvadayboyqwilizioi4ks55
Pragma  no-cache
Cache-Control   no-cache
最佳回答

您不应创建伙伴关系/X网页,而应创建ASMX网页。 如果你点击解决方案树右 mo,选择“Add”、“新项目”,然后选择网上模板(最后一份)的“网络服务”模板,你就可以在网上申请中增加新的服务。

如果你使用旧的演播室视觉版本,见。 http://www.vbdotnetheaven.com/UploadFile/mmehta/SimpleWebservice04262005065102AM/SimpleWebservice.aspx“rel=” http://www.vbdotnetheaven.com/UploadFile/mmehta/SimpleWebservice04262005065102AM/SimpleWebservice.aspx 例如。

问题回答

NOT的实际网页是否有封闭的超文本标签?

</html>




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签