Failed to create type XYZ.ashx

When I try to build my solution, I get I can’t create the Upload.ashx type. I pull out my hair to solve this problem. Can someone suggest me how to fix this problem. And I don't know how to actually add a namespace to a class?

Since I have Here is my code:

<%@ WebHandler Language="vb" CodeBehind="Upload.ashx.vb" Class="Upload" %>

And this is my structure:

wwwroot/Test/Myproject
+5
source share
5 answers

I don’t think there is such a type of .ashx.vb file.

Try changing the top line to:

<%@ WebHandler Language="VB" Class="Upload" %>

and then just put the code after the code in the .ashx file

<%@ WebHandler Language="VB" Class="Upload" %>

Imports System
Imports System.Web

Public Class Upload : Implements IHttpHandler

    'Code here....

End Class

Alternatively, did you try to create your code?

See this similar question for more help:

Http IIS7 and ASP.NET Custom Handlers

+2

" ", .

, "restserver", , "restServer" ( S), , , , .

VS ASHX.

0

, , google, , : - handler - -. (-) codeFile (webapp) codeBehind:

<%@ WebHandler Language="vb" CodeFile="Upload.ashx.vb" Class="Upload" %>
0

<%@ Assembly  Name="YourNameSpace.YourHandlerClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=90e3045b123af1c3" %>

WebHandler

<%@ WebHandler Language="vb" CodeBehind="Upload.ashx.vb" Class="Upload" %>
0

, . Assembly by @sagar-s . , ( ):

<%@ Assembly Src="~/MyService.ashx.cs" %>
<%@ WebHandler Language="C#" CodeBehind="MyService.ashx.cs" Class="Namespace.MyService" %>

Src Name . CodeBehind Src . , Src , CodeBehind . 3 - , .

0

All Articles