I got a sample application to install on IIS from a vendor that I am testing for making barcodes.
The aspx pages work fine, but when the aspx page calls the ashx page, I get the error below:
Server Error in '/BarcodeSample' 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 'TECIT.OnlineBarcodes.BarcodeHandler'.
Source Error:
Line 1: <%@ WebHandler Language="C#" CodeBehind="BarcodeHandler.ashx.cs" Class="TECIT.OnlineBarcodes.BarcodeHandler" %>
Source File: /BarcodeSample/BarcodeHandler.ashx Line: 1
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3634; ASP.NET Version:2.0.50727.3634
Why is this happening? How can I get this ashx file to work?
What is an ASHX file? An ASHX file is a webpage that is used by the ASP.NET HTTP Handler to serve user with the pages that are referenced inside this file. The ASP.NET HTTP Handler processes the incoming request, references the pages from the . ashx file, and sends back the compiled page back to the user's browser.
For adding ashx file follow below steps. Right click on Project. Select Add from the menu. In Add New Item dialog window select Generic Handler and click on Add.
An ashx file is a just a generic HTTP handler, so the easiest way to get this working is to create a new Web Site in the File menu, and just add the Handler. ashx file to the website root directory. Then, just run the site (F5) and browse to " YourSite/Handler. ashx ".
Check the full name of the class starting from the namespace (if used). I had the same issue and it was fixed after changing the class name like this:
<%@ WebHandler Language="C#" Class="Namespace.ClassName" %>
instead of this:
<%@ WebHandler Language="C#" Class="ClassName" %>
A simple workaround that I found works:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With