html" title=class>class="article_content clearfix">
html" title=class>class="htmledit_views">
.ashx 文件用于写html" title=web>web handler的。其实就是带HTML和C#的混合文件。当然你完全可以用.aspx 的文件后缀。使用.ashx 可以让你专注于编程而不用管相关的WEB技术。.ashx必须包含IsReusable. 如下例所示
<% @ html" title=web>webhandler language="C#" html" title=class>class="AverageHandler" %>
using System;
using System.Web;
public html" title=class>class AverageHandler : IHttpHandler
{
public bool IsReusable
{ get { return true; } }
public void ProcessRequest(HttpContext ctx)
{
ctx.Response.Write("hello");
}
}
<% @ html" title=web>webhandler language="C#" html" title=class>class="AverageHandler" %>
using System;
using System.Web;
public html" title=class>class AverageHandler : IHttpHandler
{
public bool IsReusable
{ get { return true; } }
public void ProcessRequest(HttpContext ctx)
{
ctx.Response.Write("hello");
}
}