per l'amministratore: ho sbagliato la sezione, potresti gentilmente spostarmi il messaggio sotto ASP.NET? grazie
sto cercando di fare un httpHandler personalizzato per un determinato tipo di file: es(".p7m")
ho creato un file .ashx all'interno della soluzione
codice:
<%@ WebHandler Language="VB" Class="p7mHandler" %>
Imports System
Imports System.Web
Public Class p7mHandler : Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
'codice di esempio che scrive solo un testo
context.Response.ContentType = "text/plain"
context.Response.Write("Hello World")
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
registro il mio httpHandler nel web.config
codice:
<system.web>
<httpHandlers>
<add type="p7mHandler" verb="*" path="*.p7m" />
</httpHandlers>
</system.web>
quando vado a richiamare un file ".p7m" dalla mia applicazione mi aspetto che vega richiamato il mio handler e mi visualizzi il testo di esempo che sta all'interno
ma mi da errore:
impossibile caricare il tipo p7mHandler
codice:
Riga 15: <system.web>
Riga 16: <httpHandlers>
Riga 17: <add type="p7mHandler" verb="*" path="*.p7m"/> '<---- da errore qui
Riga 18: </httpHandlers>
Riga 19: <!--
manca qualcosa? c'e' da fare qualche settaggio prima?