Class BaseHttpHandler
Inheritance
Namespace: DotNetNuke.Framework
Assembly: DotNetNuke.dll
Syntax
public abstract class BaseHttpHandler : IHttpHandler
Properties
| Improve this Doc View SourceContent
Gets the string representation of the body of the incoming request.
Declaration
public string Content { get; }
Property Value
Type | Description |
---|---|
System.String |
ContentEncoding
Gets the content encoding for the response object.
Declaration
public virtual Encoding ContentEncoding { get; }
Property Value
Type | Description |
---|---|
Encoding | The content encoding for the response object. |
ContentMimeType
Gets the content MIME type for the response object.
Declaration
public virtual string ContentMimeType { get; }
Property Value
Type | Description |
---|---|
System.String | The content MIME type for the response object. |
Context
Gets the
Declaration
public HttpContext Context { get; }
Property Value
Type | Description |
---|---|
HttpContext |
HasPermission
Gets a value indicating whether the requester has the necessary permissions.
Declaration
public virtual bool HasPermission { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
By default all authenticated users have permssions.
This property is only enforced if RequiresAuthentication is true
.
IsReusable
Declaration
public virtual bool IsReusable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Request
Gets the
Declaration
public HttpRequest Request { get; }
Property Value
Type | Description |
---|---|
HttpRequest |
RequiresAuthentication
Gets a value indicating whether this handler requires users to be authenticated.
Declaration
public virtual bool RequiresAuthentication { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Response
Gets the
Declaration
public HttpResponse Response { get; }
Property Value
Type | Description |
---|---|
HttpResponse |
Methods
| Improve this Doc View SourceHandleRequest()
Handles the request. This is where you put your business logic.
Declaration
public abstract void HandleRequest()
Remarks
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)
Processs the incoming HTTP request.
Declaration
public void ProcessRequest(HttpContext context)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | Context. |
RespondFileNotFound()
Helper method used to Respond to the request that the file was not found.
Declaration
protected void RespondFileNotFound()
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.
Declaration
protected void RespondForbidden()
RespondInternalError()
Helper method used to Respond to the request that an error occurred in processing the request.
Declaration
protected void RespondInternalError()
SetResponseCachePolicy(HttpCachePolicy)
Sets the cache policy. Unless a handler overrides this method, handlers will not allow a respons to be cached.
Declaration
public virtual void SetResponseCachePolicy(HttpCachePolicy cache)
Parameters
Type | Name | Description |
---|---|---|
HttpCachePolicy | cache | Cache. |
ValidateParameters()
Validates the parameters. Inheriting classes must implement this and return true if the parameters are valid, otherwise false.
Declaration
public abstract bool ValidateParameters()
Returns
Type | Description |
---|---|
System.Boolean |
|