2011-09-24 3 views
1

Je reçois l'erreur suivante du gestionnaire http suivant. D'autres fichiers ashx fonctionnent. Dites-moi si vous avez besoin de plus d'info ...erreur ashx Gestionnaire de http

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"); 
     // 

    } 
} 

Répondre

1

la classe dans les informations d'erreur est "WebApplication18.Handler1", mais il est "csIPNexample" dans le code que vous avez fourni . Etes-vous sûr d'avoir posté le bon code?

+0

Oui, http://aspspider.net/einUsername%5cHandler1.ashx // ASP .NET C# ... public partial class Handler1: System.Web.UI.Page { Page_Load vide protégé (expéditeur d'objet , EventArgs e) { // consignation des messages ipn ... veillez à donner // autorisation de traiter l'exécution de ce code string logPathDir = ResolveUrl ("Messages"); chaîne logPath = chaîne.Format ("{0} \\ {1} .txt", Server.MapPath (logPathDir), DateTime.Now.Ticks); File.WriteAllText (logPath, "hi"); // } } – einUsername

Questions connexes