浏览 web/_layouts/handler/ahandler.ashx 时出现此错误
An error occurred during the processing of /_layouts/handler/ahandler.ashx. Could not create type 'BabyClubDemo.Layouts.Handler.AHandler'.
这是我的 ashx 页面
<%@ WebHandler Language="C#" CodeBehind="AHandler.ashx.cs" Class="BabyClubDemo.Layouts.Handler.AHandler" %>
这是我的 ashx.cs
using System;
using System.Web;
namespace BabyClubDemo.Layouts.Handler
{
public class AHandler : IHttpHandler
{
/// <summary>
/// You will need to configure this handler in the web.config file of your
/// web and register it with IIS before being able to use it. For more information
/// see the following link: http://go.microsoft.com/?linkid=8101007
/// </summary>
#region IHttpHandler Members
public bool IsReusable
{
// Return false in case your Managed Handler cannot be reused for another request.
// Usually this would be false in case you have some state information preserved per request.
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.Clear();
context.Response.ContentType = "application/json; charset=utf-8";
context.Response.Write(CallServerFunction(context));
}
private string CallServerFunction(HttpContext context)
{
return "testing the applicaiton";
}
#endregion
}
}
可能是什么问题?我的 .net 框架是 3.5。