我尝试将参数传递给我的 Web 服务并在文本框中显示结果。我的网络服务正在工作。我在浏览器中调用了方法...我认为我的 Jquery 有问题。
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="QRCode.aspx.cs" Inherits="QRCODE_QRCode"
meta:resourceKey="Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="System.Web.Ajax" Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head id="Head1" runat="server">
<title>Check-In & Check-Out </title>
<script language="javascript" type="text/javascript">
function capture() {
var urlValue = window.location;
var urlText = urlValue.toString();
var start = urlText.indexOf("=") + 1;
var nameText = urlText.substring(start, urlText.length);
document.getElementById('PanelID').value = nameText;
}
window.onload = capture
function loadDate() {
jQuery.support.cors = true;
var PanelIDs = document.getElementById('PanelID').value;
alert(PanelIDs);
$.ajax({
type: "POST",
url: "http://entwicklung.de/Web/Service1.asmx/getDatetime",
data: { "PanelIDs": PanelIDs },
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
$("#textbox").text(data.d);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(jqXHR);
alert(textStatus);
alert(errorThrown);
}
});
}
</script>
</head>
<body>
<h1>Check-In und Check-Out von Besprechungen</h1>
<form id="form1" runat="server">
<p>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
Raum: <asp:TextBox type="text" name="Panels" id="PanelID" value="" runat="server"></asp:TextBox>
<br /> <br />
<asp:textbox ID="textbox" mode="multiline" runat="server" Coloumns="20" Rows="4"
Height="230px" Width="405px"></asp:textbox>
<asp:Button ID="button" runat="server" Text="Check-In" Width="99px"
OnClientClick="return loadDate();" />
<asp:Button ID="button1" runat="server" Text="Check_Out" Width="99px" />
</p>
</form>
</body>
</html>
我在做什么错?感谢帮助