I am using visual studio 10 .Net framework 4.0. I want to send a HTTP response with status code 401. I tried the solution from this.
My code is:
context.Response.ClearContent();
context.Response.StatusCode = (int) HttpStatusCode.Unauthorized;
context.Response.End();
But I still get status code 200. How do I generate 401 status code?