0

This is my code:

class HandlerTest : IHttpHandler,System.Web.SessionState.IRequiresSessionState
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.Write(DateTime.Now.ToString());

        context.Response.Cache.SetExpires(context.Timestamp.AddSeconds(10));
        context.Response.Cache.SetMaxAge(new TimeSpan(0, 0, 10));
        context.Response.Cache.SetCacheability(HttpCacheability.Public);
        context.Response.Cache.SetLastModified(context.Timestamp);
        context.Response.Cache.SetValidUntilExpires(true);
        context.Response.Cache.VaryByParams.IgnoreParams = true;

        context.Response.End();
    }
    public bool IsReusable
    {
        get { return true; }
    }
}

It doesn't work. Who can tell me how should I do?

skaffman
  • 398,947
  • 96
  • 818
  • 769

1 Answers1

0

I know, When I removed this line ,it was be right.

context.Response.End();

I hope this question can help anyone.By the way,my English is very poor.