C# 클래스 Subtext.Extensibility.Web.BaseHttpHandler

An abstract base Http Handler for all your IHttpHandler needs.

For the most part, classes that inherit from this class do not need to override ProcessRequest. Instead implement the abstract methods and properties and put the main business logic in the HandleRequest.

HandleRequest should respond with a StatusCode of 200 if everything goes well, otherwise use one of the various "Respond" methods to generate an appropriate response code. Or use the HttpStatusCode enumeration if none of these apply.

상속: IHttpHandler
파일 보기 프로젝트 열기: ayende/Subtext

공개 메소드들

메소드 설명
HandleRequest ( HttpContext context ) : void

Handles the request. This is where you put your business logic.

This method should result in a call to one (or more) of the following methods:

context.Response.BinaryWrite();

context.Response.Write();

context.Response.WriteFile();

someStream.Save(context.Response.OutputStream);

etc...

If you want a download box to show up with a pre-populated filename, add this call here (supplying a real filename).

Response.AddHeader("Content-Disposition" , "attachment; filename=\"" + Filename + "\"");

ProcessRequest ( HttpContext context ) : void

Processs the incoming HTTP request.

SetResponseCachePolicy ( System.Web.HttpCachePolicy cache ) : void

Sets the cache policy. Unless a handler overrides this method, handlers will not allow a respons to be cached.

ValidateParameters ( HttpContext context ) : bool

Validates the parameters. Inheriting classes must implement this and return true if the parameters are valid, otherwise false.

보호된 메소드들

메소드 설명
RespondFileNotFound ( HttpContext context ) : void

Helper method used to Respond to the request that the file was not found.

RespondForbidden ( HttpContext context ) : void

Helper method used to Respond to the request that the request in attempting to access a resource that the user does not have access to.

RespondInternalError ( HttpContext context ) : void

Helper method used to Respond to the request that an error occurred in processing the request.

메소드 상세

HandleRequest() 공개 추상적인 메소드

Handles the request. This is where you put your business logic.

This method should result in a call to one (or more) of the following methods:

context.Response.BinaryWrite();

context.Response.Write();

context.Response.WriteFile();

someStream.Save(context.Response.OutputStream);

etc...

If you want a download box to show up with a pre-populated filename, add this call here (supplying a real filename).

Response.AddHeader("Content-Disposition" , "attachment; filename=\"" + Filename + "\"");

public abstract HandleRequest ( HttpContext context ) : void
context System.Web.HttpContext Context.
리턴 void

ProcessRequest() 공개 메소드

Processs the incoming HTTP request.
public ProcessRequest ( HttpContext context ) : void
context System.Web.HttpContext Context.
리턴 void

RespondFileNotFound() 보호된 메소드

Helper method used to Respond to the request that the file was not found.
protected RespondFileNotFound ( HttpContext context ) : void
context System.Web.HttpContext Context.
리턴 void

RespondForbidden() 보호된 메소드

Helper method used to Respond to the request that the request in attempting to access a resource that the user does not have access to.
protected RespondForbidden ( HttpContext context ) : void
context System.Web.HttpContext Context.
리턴 void

RespondInternalError() 보호된 메소드

Helper method used to Respond to the request that an error occurred in processing the request.
protected RespondInternalError ( HttpContext context ) : void
context System.Web.HttpContext Context.
리턴 void

SetResponseCachePolicy() 공개 메소드

Sets the cache policy. Unless a handler overrides this method, handlers will not allow a respons to be cached.
public SetResponseCachePolicy ( System.Web.HttpCachePolicy cache ) : void
cache System.Web.HttpCachePolicy Cache.
리턴 void

ValidateParameters() 공개 추상적인 메소드

Validates the parameters. Inheriting classes must implement this and return true if the parameters are valid, otherwise false.
public abstract ValidateParameters ( HttpContext context ) : bool
context System.Web.HttpContext Context.
리턴 bool