简体   繁体   English

ashx错误http处理程序

[英]ashx error http handler

I'm getting the following error from the following http handler. 我从以下http处理程序中收到以下错误。 Other ashx files are working. 其他ashx文件正在运行。 Tell me if you need more info... 告诉我您是否需要更多信息...

Server Error in '/einUsername' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not create type 'WebApplication18.Handler1'.

Source Error: 


Line 1:  <%@ WebHandler Language="C#" CodeBehind="Handler.ashx.cs" Class="WebApplication18.Handler1" %>

Source File: /einUsername/Handler.ashx    Line: 1 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Code

using System;
using System.IO;
using System.Text;
using System.Net;
using System.Web;

public partial class csIPNexample : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        // logging ipn messages... be sure that you give write
        // permission to process executing this code
        string logPathDir = ResolveUrl("Messages");
        string logPath = string.Format("{0}\\{1}.txt",
                         Server.MapPath(logPathDir), DateTime.Now.Ticks);
        File.WriteAllText(logPath, "hi");
        //

    }
}

the class in the error info is "WebApplication18.Handler1", however it is "csIPNexample" in the code you provided. 错误信息中的类为“ WebApplication18.Handler1”,但是在您提供的代码中为“ csIPNexample”。 Are you sure you posted correct code? 您确定张贴了正确的代码吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM