2
为什么ASP.NET 3.5 Web应用程序中的默认“通用处理程序”代码将属性添加到类中,但没有将正确的名称空间引用添加到属性中。这是他们给你出的现成的模板:ASP.NET 3.5中的处理程序(ASHX)发生了什么
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Handler1
{
/// <summary>
/// Summary description for $codebehindclassname$
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class People : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
为什么他们不具备在顶部的一行:
using System.Web.Services;
这是微软的默认模板中的错误?我错过了什么吗?
我动过到MVC。但是我仍然需要在一些升级到3.5的旧应用程序中使用ASHX文件。我只是修复我的模板。感谢您的所有帮助+1并回答。 – BuddyJoe 2009-02-03 20:09:18