John
John

Reputation: 1890

asp.net ashx image simple example not compiling

I am trying to get this simple example working from http://www.dotnetperls.com/ashx.

When I add the '<%@ WebHandler Language="C#" Class="Handler" %>' first line the compiler highlights every line and gives two errors as per screenshot.

I have tried visual studio build actions of 'Content' and 'Compile' but no difference.

Screenshot



I've got to be missing something simple here!?

Upvotes: 0

Views: 1130

Answers (1)

Kapil Khandelwal
Kapil Khandelwal

Reputation: 16144

Remove '<%@ WebHandler Language="C#" Class="Handler" %>' form .ashx.cs file. This is for .ashx file.

To view the content of .ashx file, right click on .ashx file & click on View Markup as shown the screen shot below.

enter image description here

Upvotes: 4

Related Questions