0
표준 .html 페이지에서 .aspx 페이지로 AJAX 요청을 보내려고합니다. 난이게 할 수있는 일인지보고 싶지만 '상태 코드 : HTTP/1.1 500 내부 서버 오류'가 계속 나타납니다. 나는 aspx가 이런 식으로 작동하도록 의도되지는 않았지만 할 수 있다고 들었다.HTML에서 ASPX로 AJAX 요청 전송
내 자바 스크립트 :
이function handleload(e) {
alert(req.responseText);
}
var req = new XMLHttpRequest();
req.open('POST', 'helloworld.aspx' , true);
req.addEventListener('error', function(e) {console.log(e)}, false);
req.addEventListener('load', handleload, false);
req.send();
내 영문 페이지 :
내 aspx.cs 페이지가<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="helloworld.aspx.cs" Inherits="helloworld" %>
:
using System;
public partial class helloworld : System.Web.UI.Page
{
public void Page_Load()
{
Response.ContentType = 'text/html';
Response.Write("Hello World!")
Response.End();
}
}
다른 페이지로 전화를 걸지 않고 무엇을하려고하십니까? – AntLaC
난 그냥 작동하도록 노력하고있어, 그래서 간단한 Hello World 테스트를 시작했다. 문자열을 반환하는 것 외에는 아무것도하지 않아도됩니다. –