为什么ashx文件不能分开写呢?.ashx和.ashx.cs
VS2010
分开写test.ashx和test.ashx.cs就报错 未能创建类型“test”。
test.ashx:
<%@ WebHandler Language="C#" CodeBehind="test.ashx.cs" Class="test" %>
test.ashx.cs:
public class test : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
}
public bool IsReusable {
get {
return false;
}
}
}
但是合起来写就没问题
<%@ WebHandler Language="C#" Class="test" %>
using System;
using System.Web;
public class test: IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
public bool IsReusable {
get {
return false;
}
}
}
怎样分开写呢?