1

我创建了 Web 服务并尝试通过启用其“ScriptService”属性从 java 脚本中调用它。但是我收到控制台错误“未捕获的引用错误:未定义自动填充”我已经在脚本管理器中注册了它的引用,但没有运气。

自动填充.asmx

namespace eService
{
/// <summary>
/// Summary description for AutoFill
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]
public class AutoFill : WebService
{

    [WebMethod(EnableSession = true)]
    public string DismissAlertNotification(int ID, int CompanyID, string SectionName)
    {


}

头文件.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="header.ascx.cs" Inherits="ePrint.Templates.header" %>


<asp:ScriptManagerProxy ID="smproxy" runat="server">
<Services>
    <asp:ServiceReference Path="~/EprintService/AutoFill.asmx" />
</Services>
</asp:ScriptManagerProxy>

<script type="text/javascript" language="javascript">

function dismiss_alert_notification(ID, CompantID, SectionName) {

    AutoFill.DismissAlertNotification(ID, CompantID, SectionName, onResponse);
}
</script>
4

0 回答 0